Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp16
- {
- class Program
- {
- static void Main(string[] args)
- {
- double CostOfVacantion = double.Parse(Console.ReadLine());
- int numOfpuzzles = int.Parse(Console.ReadLine());
- int numOfbarbies = int.Parse(Console.ReadLine());
- int numOfbears = int.Parse(Console.ReadLine());
- int numOfminions = int.Parse(Console.ReadLine());
- int numOftrucks = int.Parse(Console.ReadLine());
- int numOfallorder = numOfpuzzles + numOfbarbies + numOfbears + numOfminions + numOftrucks;
- double priceOfpuzzles = numOfpuzzles * 2.60;
- double priceOfbarbies = numOfbarbies * 3;
- double priceOfbears = numOfbears * 4.10;
- double priceOfminions = numOfminions * 8.20;
- double priceOftrucks = numOftrucks * 2;
- double priceOfallorder = priceOfpuzzles + priceOfbarbies + priceOfbears + priceOfminions + priceOftrucks;
- if (numOfallorder >= 50)
- {
- double off = priceOfallorder * 0.25;
- double finalprice = priceOfallorder - off;
- double rent = finalprice * 0.1;
- double moneyleft = finalprice - rent;
- if (moneyleft >= CostOfVacantion)
- {
- double lefting = moneyleft - CostOfVacantion;
- Console.WriteLine($"Yes! {lefting:f2} lv left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! {CostOfVacantion - moneyleft:f2} lv needed.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment