Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * This LabClass is for adding different cars in to set garages.
- *
- * @author (Henley Mumford)
- * @version (23.11.2017)
- */
- public class LabClass
- {
- // The car owners name
- private String drivername;
- // Which garage it is in.
- private String garage;
- // What date the car was checked in
- private String timeAndDay;
- // How many cars the garage can fit in
- private int capacity;
- /**
- * Constructor for objects of class LabClass
- */
- public LabClass(int maxNumberOfCars)
- {
- drivername = "unknown";
- garage = "unknown";
- timeAndDay = "unknown";
- capacity = maxNumberOfCars;
- }
- /**
- * Add a car to this LabClass.
- */
- public void addCar(Car newCar)
- {
- if (Car.size() == capacity) {
- System.out.println("This garage is full, please select another Garage.");
- }
- else {
- Car.add(newCar);
- }
- }
- /**
- * Return the number of cars currently in this garage.
- */
- public int numberOfStudents()
- {
- return Car.size();
- }
- }
Add Comment
Please, Sign In to add comment