forked from Yandex-Practicum/Java-Module-Project-YP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
36 lines (28 loc) · 991 Bytes
/
Main.java
File metadata and controls
36 lines (28 loc) · 991 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
34
35
36
package app;
import java.util.Scanner;
import service.Calculator;
public class Main {
static Scanner scanner = new Scanner(System.in);
static Calculator calculator = new Calculator(scanner);
public static boolean appClose = false;
public static void main(String[] args) {
while (!appClose) {
printMenu();
String command = scanner.next();
switch (command) {
case "1" -> calculator.startDevideCalculator();
case "2" -> {
calculator.stopDevideCalculator();
}
default -> System.err.println("Выберите пункт меню - введите: 1 или 2");
}
}
}
public static void printMenu() {
System.out.println("""
Приветствую!
Что вы хотите сделать?
1.Разделить счёт
2.Выйти""");
}
}