Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Diagnostics;
- namespace MyApp // Note: actual namespace depends on the project name.
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- //• Puzzle - BGN 2.60.
- //• Talking doll -BGN 3
- //• Teddy bear -BGN 4.10.
- //• Mignon - BGN 8.20.
- //• Truck - BGN 2
- //PriceOfTheExcursion
- Double PriceOfTheExcursion =double.Parse(Console.ReadLine());
- int Puzzle = int.Parse(Console.ReadLine());
- int TalkingDoll = int.Parse(Console.ReadLine());
- int TeddyBear = int.Parse(Console.ReadLine());
- int Mignon = int.Parse(Console.ReadLine());
- int Truck = int.Parse(Console.ReadLine());
- double toyPrice =
- (Puzzle * 2.60) +
- (TalkingDoll * 3) +
- (TeddyBear * 4.10) +
- (Mignon * 8.20) +
- (Truck * 2);
- int allToy = Puzzle + TalkingDoll + TeddyBear + Mignon + Truck;
- double incom = 0.0;
- double remainder = 0.0;
- if (allToy > 49)
- {
- incom = toyPrice * 0.75;
- }
- else
- {
- incom = toyPrice;
- }
- double totalCash = incom * 0.9;
- if (totalCash > PriceOfTheExcursion)
- {
- remainder = totalCash - PriceOfTheExcursion;
- Console.WriteLine($"Yes! {remainder:f2} lv left.");
- }
- else
- {
- remainder = PriceOfTheExcursion- totalCash;
- Console.WriteLine($"Not enough money! {remainder :f2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement