Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ToyShop
- {
- class Program
- {
- static void Main(string[] args)
- {
- double vacationPrice = double.Parse(Console.ReadLine());
- int puzzleQuantity = int.Parse(Console.ReadLine());
- int dollsQuantity = int.Parse(Console.ReadLine());
- int bearsQuantity = int.Parse(Console.ReadLine());
- int minionsQuantity = int.Parse(Console.ReadLine());
- int trucksQuantity = int.Parse(Console.ReadLine());
- int toysCount = puzzleQuantity + dollsQuantity + bearsQuantity + minionsQuantity + trucksQuantity;
- double puzzlePrice = puzzleQuantity * 2.60;
- double dollsPrice = dollsQuantity * 3.00;
- double bearsPrice = bearsQuantity * 4.10;
- double minionsPrice = minionsQuantity * 8.20;
- double truckPrice = trucksQuantity * 2.00;
- double profit = puzzlePrice + dollsPrice + bearsPrice + minionsPrice + truckPrice;
- if (toysCount >= 50)
- {
- double discount = profit * 0.25;
- profit = profit - discount;
- }
- profit = profit * 0.9; //profit = profit - profit * 0.1
- if (profit >= vacationPrice)
- {
- Console.WriteLine($"Yes! {(profit - vacationPrice):F2} lv left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! {(vacationPrice - profit):f2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment