Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ToyStore
- {
- class MainClass
- {
- public static void Main(string[] args)
- {
- //задачата за ваканцията
- double vacationPrice = double.Parse(Console.ReadLine());
- int puzzles = int.Parse(Console.ReadLine());
- int dolls = int.Parse(Console.ReadLine());
- int bear = int.Parse(Console.ReadLine());
- int minion = int.Parse(Console.ReadLine());
- int trucks = int.Parse(Console.ReadLine());
- double discount = 0;
- if ( puzzles + dolls + bear + minion + trucks > 50)
- {
- discount = 0.25;
- }
- double dollsPrice = dolls * 3;
- double puzzlesPrice = puzzles * 2.60;
- double bearsPrice = bear * 4.10;
- double minionPrice = minion * 8.20;
- double truckPrice = trucks * 2;
- double grossPrice = dollsPrice + puzzlesPrice + bearsPrice + minionPrice + truckPrice;
- double discountedPrice = discount * grossPrice;
- double finalPriceWithoutRent = grossPrice - discountedPrice;
- double finalPrice = finalPriceWithoutRent * 0.90;
- if (finalPrice > vacationPrice)
- {
- Console.WriteLine($"Yes! {finalPrice - vacationPrice:F2} lv left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! {vacationPrice - finalPrice:F2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement