-
Notifications
You must be signed in to change notification settings - Fork 0
/
Car.java
44 lines (40 loc) · 865 Bytes
/
Car.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* Car.java
*
* @autor Claudio, Jerry, Joe, Francisco
* @since 5-6-2022
*/
package oober;
/**
* The Class Car.
*/
public class Car extends RentalVehicle {
/**
* Instantiates a new car.
*
* @param id the id
* @param company the company
* @param location the initial location of the car
*/
public Car(int id, TaxiCompany company, Location location) {
super(id, company, location);
}
/**
* Calculate cost.
*
* @return the int
*/
@Override
public int calculateCost() {
return (int) (super.calculateCost() + 3.5); // Initial cost for Rental Cars is 3.5 eur.
}
/**
* To string.
*
* @return the string
*/
@Override
public String toString() {
return "Car " + super.toString();
}
}