Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double sleeveSize = Double.parseDouble(scanner.nextLine()),
- frontSize = Double.parseDouble(scanner.nextLine()),
- sum = (sleeveSize * 2 + frontSize * 2) * 1.1 / 100;
- String fabricTypes = scanner.nextLine(),
- tieOrNot = scanner.nextLine();
- sum *= switch (fabricTypes) {
- case "Linen" -> 15;
- case "Cotton" -> 12;
- case "Denim" -> 20;
- case "Twill" -> 16;
- case "Flannel" -> 11;
- default -> 0;
- };
- sum += 10;
- if (tieOrNot.equals("Yes")) {
- sum *= 1.2;
- }
- System.out.printf("The price of the shirt is: %.2flv.\n", sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement