forked from Yandex-Practicum/Java-Module-Project-YP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTalk.java
More file actions
28 lines (25 loc) · 1.06 KB
/
Talk.java
File metadata and controls
28 lines (25 loc) · 1.06 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
import java.util.Scanner;
public class Talk {
public static void Talking() {
Scanner scanner = new Scanner(System.in);
Calc calculator = new Calc();
while (true) {
System.out.println("Введите название товара");
String name = scanner.next();
System.out.println("Введите стоимость");
if (scanner.hasNextDouble()) {
double price = scanner.nextDouble();
calculator.productCalc(name, price);
System.out.println("Добавим еще? Введите любой символ.\nЕсли нет напишите \"Завершить\"");
} else {
System.out.println("Ошибка попробуй еще!");
}
String end = scanner.next();
if (end.trim().equalsIgnoreCase("завершить")) {
calculator.finCountDown(Gests.guestNumber);
System.out.println("Кониек");
break;
}
}
}
}