Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /**
- * Created:
- * User: ${USER}
- * Date: ${DATE}
- * Time: ${TIME}
- */
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double pricePuzzle = 2.60;
- double priceDolls = 3;
- double priceBears = 4.10;
- double priceMinions = 8.2;
- double priceTrucks = 2;
- double trip = Double.parseDouble(scanner.nextLine());
- int numberPuzzle = Integer.parseInt(scanner.nextLine());
- int numberDolls = Integer.parseInt(scanner.nextLine());
- int numberBears = Integer.parseInt(scanner.nextLine());
- int numberMinions = Integer.parseInt(scanner.nextLine());
- int numberTrucks = Integer.parseInt(scanner.nextLine());
- int totalNumbers = numberPuzzle + numberDolls + numberBears + numberMinions + numberTrucks;
- double Puzzle = pricePuzzle * numberPuzzle;
- double Dolls = priceDolls * numberDolls;
- double Bears = priceBears * numberBears;
- double Minions = priceMinions * numberMinions;
- double Trucks = priceTrucks * numberTrucks;
- double totalAmount = Puzzle + Dolls + Bears + Minions + Trucks;
- {
- if (totalNumbers >= 50) {
- totalAmount = totalNumbers * 0.75;
- }
- double totalAmount1 = totalAmount * 0.90;
- if (totalAmount1 >= trip) {
- System.out.println("Да, Петя ще има прекрасна екскурзия!");
- } else {
- System.out.println("За съжаление Петя щепропусне екскурзията.");
- }
- }
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement