Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Input
- double excursionPrice = double.Parse(Console.ReadLine());
- int puzzlesCount = int.Parse(Console.ReadLine());
- int dollsCount = int.Parse(Console.ReadLine());
- int bearsCount = int.Parse(Console.ReadLine());
- int minionsCount = int.Parse(Console.ReadLine());
- int trucksCount = int.Parse(Console.ReadLine());
- //Prices
- double puzzlePrice = 2.60;
- double dollPrice = 3.00;
- double bearPrice = 4.10;
- double minionPrice = 8.20;
- double truckPrice = 2.00;
- //Calculations
- double toysBill = (puzzlesCount * puzzlePrice) + (dollsCount * dollPrice) + (bearsCount * bearPrice) + (minionsCount * minionPrice) + (trucksCount * truckPrice);
- int toysCount = puzzlesCount + dollsCount + bearsCount + minionsCount + trucksCount;
- if (toysCount >= 50)
- {
- toysBill = toysBill * 0.75;
- }
- double shopRent = toysBill * 0.1;
- toysBill = toysBill - shopRent;
- //Output
- if (toysBill >= excursionPrice)
- {
- double remainingMoney = toysBill - excursionPrice;
- Console.WriteLine($"Yes! {remainingMoney:f2} lv left.");
- }
- else
- {
- double neededMoney = excursionPrice - toysBill;
- Console.WriteLine($"Not enough money! {neededMoney:f2} lv needed.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement