Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- double money = double.Parse(Console.ReadLine());
- int weekdayGoOut = int.Parse(Console.ReadLine());
- int weekendHome = int.Parse(Console.ReadLine());
- int rent = 150;
- //
- double weekDaysSum = 22 * 10;
- double singleWeekDayOut = Math.Round(money * 0.03);
- double WeekDayGoOutSum = weekdayGoOut * singleWeekDayOut;
- double WeekendSum = (8 * 20) - (weekendHome * 20 *2);
- double allExpenses = rent + weekDaysSum + WeekDayGoOutSum + WeekendSum;
- if (money>allExpenses)
- {
- double left = money - allExpenses;
- Console.WriteLine("Yes, leftover {0}.", left);
- }
- else if (money<allExpenses)
- {
- double notEnough = money - allExpenses;
- Console.WriteLine("No, not enough {0}.", -notEnough);
- }
- else if (money == allExpenses)
- {
- Console.WriteLine("Exact Budget.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment