1 changed files with 0 additions and 25 deletions
@ -1,25 +0,0 @@ |
|||
package com.rental; |
|||
public class TestCar { |
|||
public static void main(String[] args) { |
|||
Car car1 = new Car("XiangA12345", "BYD", "Han EV", 280.0); |
|||
Car car2 = new Car("XiangB67890", "Tesla", "Model 3"); |
|||
Car car3 = new Car("XiangC00001", "Toyota", "Camry", 350.0); |
|||
System.out.println("=== Initial Car Information ==="); |
|||
car1.displayInfo(); |
|||
car2.displayInfo(); |
|||
car3.displayInfo(); |
|||
System.out.println("\n=== Test Rent/Return ==="); |
|||
car1.rentCar(); |
|||
car1.rentCar(); |
|||
car1.returnCar(); |
|||
car1.returnCar(); |
|||
System.out.println("\n=== Calculate Rent ==="); |
|||
double total = car2.calculateRent(5); |
|||
System.out.println("car2 5-day rent: " + total); |
|||
System.out.println("\n=== Test Invalid Rent ==="); |
|||
car3.setDailyRent(-100); |
|||
System.out.println("car3 rent: " + car3.getDailyRent()); |
|||
System.out.println("\n=== Total Cars ==="); |
|||
System.out.println("Total: " + Car.getTotalCars()); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue