Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Input
- double budget = double.Parse(Console.ReadLine());
- int videocardsCount = int.Parse(Console.ReadLine());
- int processorsCount = int.Parse(Console.ReadLine());
- int ramsCount = int.Parse(Console.ReadLine());
- //Calculations
- double videocardsBill = videocardsCount * 250;
- double processordBill = processorsCount * (videocardsBill * 0.35);
- double ramsBill = ramsCount * (videocardsBill * 0.1);
- double bill = videocardsBill + processordBill + ramsBill;
- if (videocardsCount > processorsCount)
- {
- //bill *= 0.85
- bill = bill * 0.85;
- }
- //Output
- if (budget >= bill)
- {
- double remainingMoney = budget - bill;
- Console.WriteLine($"You have {remainingMoney:f2} leva left!");
- }
- else
- {
- double neededMoney = bill - budget;
- Console.WriteLine($"Not enough money! You need {neededMoney:f2} leva more!");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement