Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Shopping
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- int videoCardQuantity = int.Parse(Console.ReadLine());
- int processorsQuantity = int.Parse(Console.ReadLine());
- int ramQuantity = int.Parse(Console.ReadLine());
- double videoCardPrice = videoCardQuantity * 250;
- double processorsPrice = videoCardPrice* 0.35;
- double ramPrice = videoCardPrice* 0.10;
- double totalPrice = videoCardPrice + processorsPrice + ramPrice;
- if (videoCardQuantity > processorsQuantity)
- {
- totalPrice = totalPrice - (totalPrice * 0.15);
- }
- if (totalPrice <=budget)
- {
- Console.WriteLine($"You have {(budget-totalPrice):f2} leva left!");
- }
- else if (totalPrice> budget)
- {
- Console.WriteLine($"Not enough money! You need {(totalPrice-budget):f2} leva more!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment