-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication.java
More file actions
33 lines (28 loc) · 974 Bytes
/
Application.java
File metadata and controls
33 lines (28 loc) · 974 Bytes
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
package fr.valtech;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Application {
/**
* The main launcher of the application
*
* @param args
*/
public static void main(String[] args) {
FruitShop fruitShop = new FruitShop();
BufferedReader entree = new BufferedReader(new InputStreamReader(System.in));
try {
System.out.println("Welcome to the fruit shop\n");
System.out.println("Type some fruit\n");
System.out.println("=================\n");
while (true) {
final String myFruit = entree.readLine();
fruitShop.addFruit(myFruit);
System.out.print(" > " + fruitShop.getTotal() + "\n");
}
}
catch (IOException e) {
System.out.println("An error occurred: " + e.getMessage());
}
}
}