Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Toy_Shop
- {
- class Toy_shop
- {
- static void Main(string[] args)
- {
- double vacantion = double.Parse(Console.ReadLine());
- int puzzle = int.Parse(Console.ReadLine());
- int talkingDoll = int.Parse(Console.ReadLine());
- int bearDoll = int.Parse(Console.ReadLine());
- int minion = int.Parse(Console.ReadLine());
- int toyTruck = int.Parse(Console.ReadLine());
- double puzzlePrice = 2.60;
- int talkingDollPrice = 3;
- double bearDollPrice = 4.10;
- double minionPrice = 8.20;
- int toyTruckPrice = 2;
- double totalMoney = (puzzle * puzzlePrice) +
- (talkingDoll * talkingDollPrice) +
- (bearDoll * bearDollPrice) +
- (minion * minionPrice) +
- (toyTruck * toyTruckPrice);
- int totalToys = puzzle + talkingDoll + bearDoll + minion + toyTruck;
- double discount = 0;
- if (totalToys >= 50)
- {
- discount = totalMoney * 0.25;
- }
- double finalSum = totalMoney - discount;
- double rent = finalSum * 0.10;
- double profit = finalSum - rent;
- if (profit > vacantion)
- {
- double moneyLeft = profit - vacantion;
- Console.WriteLine($"Yes! {moneyLeft:F2} lv left.");
- }
- else
- {
- double moneyNeeded = vacantion - profit;
- Console.WriteLine($"Not enough money! {moneyNeeded:F2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement