Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Toy_Store
- {
- class Program
- {
- static void Main(string[] args)
- {
- double tripPrice = double.Parse(Console.ReadLine());
- int puzzelsQ = int.Parse(Console.ReadLine());
- int dollsQ = int.Parse(Console.ReadLine());
- int bearsQ = int.Parse(Console.ReadLine());
- int minionsQ = int.Parse(Console.ReadLine());
- int tracksQ = int.Parse(Console.ReadLine());
- double totalQ = puzzelsQ + dollsQ + bearsQ + minionsQ + tracksQ + tracksQ;
- double priceP = 2.60;
- double priceD = 3.00;
- double priceB = 4.10;
- double priceM = 8.20;
- double priceT = 2.00;
- double totalAmount = puzzelsQ * priceP + dollsQ * priceD + bearsQ * priceB + minionsQ * priceM + tracksQ * priceT;
- double rent = totalAmount * 0.10;
- double Proffit = totalAmount - (tripPrice + rent);
- double Lost = (tripPrice + rent) - totalAmount;
- if (Proffit >= 0)
- {
- if (totalQ >= 50 )
- {
- double amountN = totalAmount * 0.75;
- double rentN = amountN * 0.10;
- double proffit = amountN - (tripPrice + rentN);
- Console.WriteLine($"Yes! {proffit:f2} lv left.");
- }
- else
- {
- Console.WriteLine($"Yes! {Proffit:f2} lv left.");
- }
- }
- else if (Lost > 0)
- {
- if (totalQ >= 50)
- {
- double amountN = totalAmount * 0.75;
- double rentN = amountN * 0.10;
- double lostN = (tripPrice + rentN) - amountN;
- Console.WriteLine($"Not enough money! {lostN:f2} lv needed.");
- }
- else
- {
- Console.WriteLine($"Not enough money! {Lost:f2} lv needed.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement