Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace P04_ToyShopProject
- {
- class Program
- {
- static void Main()
- {
- double puzzelsPrice = 2.60;
- double barbiesPrice = 3.00;
- double bearsPrice = 4.10;
- double minersPrice = 8.20;
- double trucksPrice = 2.00;
- double priceForVacantion = double.Parse(Console.ReadLine());
- double numberOfPuzzels = double.Parse(Console.ReadLine());
- double numberOfBarbies = int.Parse(Console.ReadLine());
- double numberOfBears = double.Parse(Console.ReadLine());
- double numberOfMiners = double.Parse(Console.ReadLine());
- double numberOfTrucks = double.Parse(Console.ReadLine());
- double puzzelTotalPrice = numberOfPuzzels * puzzelsPrice;
- double barbiesTotalPrice = numberOfBarbies * barbiesPrice;
- double bearsTotalPrice = numberOfBears * bearsPrice;
- double minersTotalPrice = numberOfMiners * minersPrice;
- double truckTotalPrice = numberOfTrucks * trucksPrice;
- double totalToys = numberOfPuzzels +
- numberOfBarbies +
- numberOfBears +
- numberOfMiners +
- numberOfTrucks;
- double commonToAllPrice = puzzelTotalPrice +
- barbiesTotalPrice +
- bearsTotalPrice +
- minersTotalPrice +
- truckTotalPrice;
- if(totalToys >= 50)
- {
- double discount = 0.25 * commonToAllPrice; // паричната равностойност на отстъпката
- commonToAllPrice = commonToAllPrice - discount; // прави отстъпката
- }
- commonToAllPrice = commonToAllPrice - (commonToAllPrice * 0.1); // плаща наема
- if(commonToAllPrice >= priceForVacantion)
- {
- double remainingMoney = commonToAllPrice - priceForVacantion;
- Console.WriteLine("Yes! " + ($"{remainingMoney:f2}") +" lv left.");
- }
- else
- {
- double insufficientMoney = priceForVacantion - commonToAllPrice;
- Console.WriteLine("Not enough money! " + ($"{insufficientMoney:f2}") + " lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement