Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /**
- * Created by Ivan on 5/7/2017.
- */
- public class TaskTwo {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double priceVacantion = Double.parseDouble(scanner.nextLine());
- int numberPuzzel = Integer.parseInt(scanner.nextLine());
- int numberKukli = Integer.parseInt(scanner.nextLine());
- int numberBears = Integer.parseInt(scanner.nextLine());
- int numberMinions = Integer.parseInt(scanner.nextLine());
- int numberTruck = Integer.parseInt(scanner.nextLine());
- double prisePuzzel = numberPuzzel * 2.60;
- double priseKukli = numberKukli * 3.0;
- double priseBears = numberBears * 4.1;
- double priseMinions = numberMinions * 8.20;
- double priceTruck = numberTruck * 2.0;
- double priceGames = prisePuzzel + priseKukli + priseBears + priseMinions + priceTruck;
- int sumGames = numberPuzzel + numberKukli + numberBears + numberMinions + numberTruck;
- if (sumGames >= 50){
- double priceFee = priceGames * 0.75;
- double withNaem = priceFee * 0.9;
- System.out.printf("Yes! %.2f", (withNaem - priceVacantion));
- System.out.println(" lv left.");
- }
- else{
- // double priceFee = priceGames * 1.0;
- double withNaem = priceGames * 0.9;
- System.out.printf("Not enough money! %.2f", (priceVacantion - withNaem));
- System.out.println(" lv needed.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement