-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathScreen.java
More file actions
64 lines (56 loc) · 1.66 KB
/
Screen.java
File metadata and controls
64 lines (56 loc) · 1.66 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package garageSystem;
import java.util.Scanner;
public class Screen {
public void displayAvailableSlots(Garage ob)
{
for (int i=0;i<ob.getSlotCount();i++)
{
if (ob.getSlot(i).isFull()==false)
System.out.println("slot ("+(i+1)+")is available ");
}
if (ob.getVehicleCount() == ob.getSlotCount()){
System.out.println("Full Garage ");
}
}
public void displayNoSlot()
{
System.out.println("No Suitable Slots");
}
public void displayChosenSlot(Slot chosen)
{
System.out.println("Park in Slot " + chosen.getSlotID() + "-> width:" + chosen.getSlotWidth() + " length: " + chosen.getSlotDepth());
}
public void displayFees(double fees)
{
System.out.println("Please pay " + fees + " pounds. " );
}
public String getVehicleID(){
System.out.println("Enter your vehicle ID: " );
Scanner sc=new Scanner(System.in);
String ID =sc.nextLine();
return ID;
}
public int chooseOption(){
System.out.println("Choose an option: " );
System.out.println("1- Park in " );
System.out.println("2- Park out " );
System.out.println("3- Display all available slots " );
System.out.println("4- Admin " );
Scanner sc=new Scanner(System.in);
int Choice =sc.nextInt();
return Choice;
}
public int chooseAdminOptions(){
System.out.println("Admin Options: " );
System.out.println("1- View total vehicles" );
System.out.println("2- View total income" );
System.out.println("3- Display all available slots " );
//System.out.println("4- Admin " );
Scanner sc=new Scanner(System.in);
int Choice =sc.nextInt();
return Choice;
}
public void printTotalIncome(Garage garage){
System.out.println("Total Income: " + garage.getTotalIncome());
}
}