Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _08._Toy_Shop
- {
- class Program
- {
- static void Main()
- {
- double excursionPrice = double.Parse(Console.ReadLine());
- int numPuzzels = int.Parse(Console.ReadLine());
- int numDolls = int.Parse(Console.ReadLine());
- int numBears = int.Parse(Console.ReadLine());
- int numMinions = int.Parse(Console.ReadLine());
- int numTrucks = int.Parse(Console.ReadLine());
- double income = numPuzzels * 2.60 + numDolls * 3.0 + numBears * 4.10 + numMinions * 8.20 + numTrucks * 2.0;
- int numOfToys = numPuzzels + numDolls + numBears + numMinions + numTrucks;
- if (numOfToys >= 50)
- {
- income = income - income * 0.25;
- }
- income = income - income * 0.10;
- if (excursionPrice <= income)
- {
- Console.WriteLine("Yes! {0:F2} lv left.", income - excursionPrice);
- }
- else
- {
- Console.WriteLine("Not enough money! {0:F2} lv needed.", Math.Abs(income - excursionPrice));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement