-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavaHW2104.java
More file actions
36 lines (25 loc) · 1.33 KB
/
JavaHW2104.java
File metadata and controls
36 lines (25 loc) · 1.33 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
29
30
31
32
33
34
35
36
package homework;
import java.util.Locale;
import java.util.Scanner;
public class JavaHW2104 {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
System.out.println("сколько коробок вы хотите отправить?");
int amount = reader.nextInt();
System.out.println("сколько весит каждая коробка в киллограммах?");
double weight = reader.nextDouble();
System.out.println("Введите имя получателя посылки:");
reader.nextLine(); // stub
String name = reader.nextLine();
System.out.println("Введите фамилию получателя:");
String secondName = reader.nextLine();
System.out.println("Введите адрес получателя посылки:");
String address = reader.nextLine();
double totalWeight = amount * weight;
System.out.println("Получатель: \"" + name.toUpperCase() + " " + secondName.toUpperCase() + "\"\n"
+ "Адрес: \"" + address.toUpperCase() + "\"\n"
+ "Вес посылки: " + totalWeight + " kg");
System.out.println("Все верно? да/нет");
boolean isCorrect = reader.hasNextBoolean();
}
}