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