Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _07.Shopping
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- double budgett = double.Parse(Console.ReadLine());
- int countOfVideoCardss = int.Parse(Console.ReadLine());
- int CountOfProcessors = int.Parse(Console.ReadLine());
- int countOfRamMemorys = int.Parse(Console.ReadLine());
- double priceForVideoCards = 250;
- double sumVideoCardss = countOfVideoCardss * priceForVideoCards;
- double pricePerProcessors = sumVideoCardss * 0.35;
- double sumProcessors = CountOfProcessors * pricePerProcessors;
- double pricePerRams = sumVideoCardss * 0.10;
- double sumRams = pricePerRams * countOfRamMemorys;
- double fullPrice = sumProcessors + sumRams + sumVideoCardss;
- if (countOfVideoCardss > CountOfProcessors)
- {
- fullPrice = fullPrice - (fullPrice * 0.15);
- }
- else
- {
- fullPrice = sumProcessors + sumRams + sumVideoCardss;
- }
- if (budgett >= fullPrice)
- {
- double moneyLeft = budgett - fullPrice;
- Console.WriteLine($"You have {moneyLeft:f2} leva left!");
- }
- else
- {
- double moneyNeeded = fullPrice - budgett;
- Console.WriteLine($"Not enough money! You need {moneyNeeded:f2} leva more!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement