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
22 lines (21 loc) · 983 Bytes
/
Main.java
File metadata and controls
22 lines (21 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// dev branch for Y.Practicum
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner inPeople = new Scanner(System.in);
Scanner chek = new Scanner(System.in);
System.out.println("На сколько человек необходимо разделить счет?");
int quantityPeople = inPeople.nextInt();
System.out.println("Вы ввели - " + quantityPeople);
while (quantityPeople <= 1) {
System.out.println("Число должно быть больше 1, введите еще раз:");
quantityPeople = inPeople.nextInt();
if (quantityPeople > 1)
break;
}
System.out.println("Введите сумму счета");
double summa = chek.nextInt();
double resultat = Calculate.calculater(summa, quantityPeople);
System.out.println("Итого на человека:" + resultat);
}
}