-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
42 lines (27 loc) · 1.24 KB
/
Main.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
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
CashRegister unicafeExactum = new CashRegister();
ArrayList<LyyraCard> lyyraCards = new ArrayList<LyyraCard>();
Menu gourmet = new Menu("Gourmet",4.0);
Menu economical = new Menu("Economical",2.5);
LyyraCard card1 = new LyyraCard(100.0,"Jimny",29,3,1983);
lyyraCards.add(card1);
System.out.println( unicafeExactum );
System.out.println("the card balance " + card1.balance() + " euros");
while (true){
System.out.println("1.Pay gourmet(4.0)");
System.out.println("2.Pay economical(2.5)");
System.out.println("3.Get balance and exit");
System.out.println("Choose an option:");
Scanner reader = new Scanner(System.in);
String option = reader.nextLine();
if(option.contains("1")){
unicafeExactum.pay(card1,economical);
System.out.println( unicafeExactum );
System.out.println(" Your card balance is: "+card1.balance());
}
}
}
}