Make an interaction diagram for the parking office class below. We have included the class code below. The diagram should not be hand-drawn Use the class diagram to better understand all classes in our system
Make an interaction diagram for the parking office class below. We have included the class code below. The diagram should not be hand-drawn
Use the class diagram to better understand all classes in our system
public class ParkingOffice {
String name;
String address;
String phone;
List<Customer> customers;
List<Car> cars;
List<ParkingLot> lots;
List<ParkingCharge> charges;
public ParkingOffice(){
customers = new ArrayList<>();
cars = new ArrayList<>();
lots = new ArrayList<>();
charges = new ArrayList<>();
}
public Customer register() {
Customer cust = new Customer(name,address,phone);
customers.add(cust);
return cust;
}
public Car register(Customer c,String licence, CarType t) {
Car car = new Car(c,licence,t);
cars.add(car);
return car;
}
public Customer getCustomer(String name) {
for(Customer cust : customers)
if(cust.getName().equals(name))
return cust;
return null;
}
public double addCharge(ParkingCharge p) {
charges.add(p);
return p.amount;
}
public String[] getCustomerIds(){
String[] stringArray1 = new String[5];
for(int i=0;i<5;i++){
stringArray1[i] = customers.get(i).customerID;
}
return stringArray1;
}
public String [] getPermitID () {
String[] stringArray2 = new String[5];
for(int i=0;i<5;i++){
stringArray2[i] = charges.get(i).permitID;
}
return stringArray2;
}
public List<String> getPermitIds(Customer c){
List<String> permitid = new ArrayList<String>();
for(Car car:cars){
if(car.owner == c.customerId)
permitid.add(car.permit);
}
return permitid;
}
}
![ParkingOffice
Customer
+name: String
+customerlD: int
+address: String
+name: String
+phone: String
+address: String
+customers: Customer[]
+phone: String
+cars: Car)
+Customer(String, string, String)
+ lots: ParkingLot[]
+getName(): String
+charges: ParkingCharges[]
+ParkingOffice()
+register(): Customer
CarType
+register(Customer, String, CarType ): Car
1.1
+getCustomer(Customer): Customer
Car
+addCharges(ParkingCharge): double
+owner: Customer
+getCustomerIDs(: String]
+ licence: String
+getPermitID(): String[]
+t CarType
+getPermitlds(Customer): List<String>
+Car(Customer, String, CarType)
ParkingCharges
+amount: double
ParkingLot
+permitID: int
getPermitI D(): int](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F0148e73e-0d28-4d98-a412-189d898de2e8%2F1a5e7a6a-3e43-4c82-96b9-e25f875852d9%2Fjfr5vgp_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)