Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _02._Summer_Shopping
- {
- class Program
- {
- static void Main(string[] args)
- {
- int budget = int.Parse(Console.ReadLine());
- double towelPrice = double.Parse(Console.ReadLine());
- int discount = int.Parse(Console.ReadLine());
- double umbrella = 2 * towelPrice / 3;
- double slippers = umbrella * 0.75;
- double beachBag = 1 * (towelPrice + slippers) / 3;
- double totalSum = towelPrice + umbrella + slippers + beachBag;
- totalSum = totalSum - totalSum * 0.05;
- if (budget >= totalSum)
- {
- Console.WriteLine($"Annie's sum is {totalSum:f2} lv. She has {Math.Abs(totalSum - budget):f2} lv. left.");
- }
- else
- {
- Console.WriteLine($"Annie's sum is {totalSum:f2} lv. She needs {budget - totalSum:f2)} lv. more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement