-length, capacity, speed (must be an integer)
-fuel_capacity, fuel_burn_rate (must be a double)
-name, color (must be a string)
-name
-length
-capacity
-color
-speed
-fuel_capacity
-fuel_burn_rate
public class Main {
public static void main(String[] args) {
}
}
class Bus{
int length, capacity, speed;
double fuelCapacity, fuelBurnRate;
String name, color;
public Bus(int length, int capacity, int speed, double fuelCapacity, double fuelBurnRate, String name, String color) {
this.length = length;
this.capacity = capacity;
this.speed = speed;
this.fuelCapacity = fuelCapacity;
this.fuelBurnRate = fuelBurnRate;
this.name = name;
this.color = color;
}
}
Comments