Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ToyShop
- {
- class Program
- {
- static void Main(string[] args)
- {
- double vacationPrice = double.Parse(Console.ReadLine());
- int numPuzzles = int.Parse(Console.ReadLine());
- int numTalkingDolls = int.Parse(Console.ReadLine());
- int numBears = int.Parse(Console.ReadLine());
- int numMinions = int.Parse(Console.ReadLine());
- int numTrucks = int.Parse(Console.ReadLine());
- double total = numPuzzles * 2.60 + numTalkingDolls * 3 + numBears * 4.10 + numMinions * 8.20 + numTrucks * 2;
- int numToys = numPuzzles + numTalkingDolls + numBears + numMinions + numTrucks;
- if (numToys >= 50)
- {
- total = total - total * 0.25;
- }
- total = total - total * 0.10;
- if (total >= vacationPrice)
- {
- Console.WriteLine($"Yes! {total - vacationPrice:f2} lv left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! {vacationPrice - total:f2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment