Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _02.Shopping
- {
- class Shopping
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- double numVideoCards = double.Parse(Console.ReadLine());
- double numProcessors = double.Parse(Console.ReadLine());
- double numRamMemory = double.Parse(Console.ReadLine());
- double priceVideoCards = numVideoCards * 250.0;
- double priceProcessor = numProcessors * (priceVideoCards * 0.35);
- double priceRamMemory = numRamMemory * (priceVideoCards * 0.10);
- double all = priceVideoCards + priceProcessor + priceRamMemory;
- if (numVideoCards > numProcessors)
- {
- all = all * 0.85;
- }
- double difference = Math.Abs(budget - all);
- if (budget >= all)
- {
- Console.WriteLine($"You have {difference:f2} leva left!");
- }
- else
- {
- Console.WriteLine($"Not enough money! You need {difference:f2} leva more!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement