Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Exe2 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double Vacation = Double.parseDouble(scanner.nextLine());
- double puzzles = Double.parseDouble(scanner.nextLine());
- double dolls = Double.parseDouble(scanner.nextLine());
- double teddy = Double.parseDouble(scanner.nextLine());
- double minions = Double.parseDouble(scanner.nextLine());
- double trucks = Double.parseDouble(scanner.nextLine());
- double Profit = puzzles * 2.60 + dolls * 3 + teddy * 4.10 + minions * 8.20 + trucks * 2;
- double TotalNumbers = puzzles + dolls + teddy + minions + trucks;
- double case1 = 0.00;
- if (TotalNumbers >= 50) {
- case1 = Profit * 0.75;
- }
- double Total = case1 * 0.90;
- if (Vacation <= Total) {
- System.out.printf("Yes! %.2f lv left.", Total - Vacation);
- } else {
- System.out.printf("Not enough money! %.2f lv needed.", Math.abs(Total - Vacation));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement