ControlC ControlC.com

class TestVehicle1

Views: 61Total Chars: 606
Created: 4/18/13 11:26:26PM ET
Self Destructs: Never
package prakpl;
public class TestVehicle1{
public static void main(String[] args){

System.out.println("Creating a vehicle with a 10,000 kg maximum load.");
Vehicle1 vehicle = new Vehicle1(10000);

System.out.println("Add box #1 (500kg) : " + vehicle.addBox(500));
System.out.println("Add box #2 (250kg) : " + vehicle.addBox(250));
System.out.println("Add box #3 (5000kg) : " + vehicle.addBox(5000));
System.out.println("Add box #4 (4000kg) : " + vehicle.addBox(4000));
System.out.println("Add box #5 (300kg) : " + vehicle.addBox(300));
System.out.println("Vehicle load is " +vehicle.getLoad() + "kg");
}
}
606 chars, 73 words, 15 lines·Create new version