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