Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- double tripPrice = double.Parse(Console.ReadLine());
- int puzzleAmount = int.Parse(Console.ReadLine());
- int dollsAmount = int.Parse(Console.ReadLine());
- int teddybearsAmount = int.Parse(Console.ReadLine());
- int minionsAmount = int.Parse(Console.ReadLine());
- int trucksAmount = int.Parse(Console.ReadLine());
- double puzzlePrice = 2.60;
- double dollPrice = 3;
- double teddybearPrice = 4.10;
- double minionPrice = 8.20;
- double truckPrice = 2;
- double rent = 0.0;
- double moneyWon = 0.0;
- double sumPrice = puzzleAmount * puzzlePrice + dollsAmount * dollPrice + teddybearsAmount * teddybearPrice + minionsAmount * minionPrice + trucksAmount * truckPrice;
- int countToys = puzzleAmount + dollsAmount + teddybearsAmount + minionsAmount + trucksAmount;
- if (countToys >= 50)
- {
- double discount = 0.25 * sumPrice;
- double finalDiscountPrice = sumPrice - discount;
- rent = 0.1 * finalDiscountPrice;
- moneyWon = finalDiscountPrice - rent;
- }
- else if (countToys < 50)
- {
- rent = 0.1 * sumPrice;
- moneyWon = sumPrice - rent;
- }
- if (moneyWon >= tripPrice)
- {
- Console.WriteLine("Yes! {0:0.00} lv left.", moneyWon-tripPrice);
- }
- else if (moneyWon < tripPrice)
- {
- Console.WriteLine("Not enough money! {0:0.00} lv needed.", tripPrice-moneyWon);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement