Route used by

Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2020-12-02 00:02:08 +03:00
parent 51bf50ec6d
commit 271395654c
Signed by: Hesham
GPG Key ID: 74876157D199B09E

View File

@ -199,7 +199,12 @@ public class MakkahCity {
}
if (choice.equals("4")){
for (int i = 0; i < stdRoutes.length; i++){
System.out.printf("[%d] %s\n", i, stdRoutes[i]);
int count = 0;
for (Campaign campaign : listOfCampaigns)
if (campaign.getRoute() == stdRoutes[i])
count += campaign.getVehicles().size();
System.out.printf("[%d] %sUsed By %d buses\n\n", i, stdRoutes[i], count);
}
}
if (choice.equals("5")) return;