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