Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- class Program
- {
- static void Main()
- {
- string []inp = Console.ReadLine().Split('\\');
- string day = inp[0];
- decimal moneyPerHour = decimal.Parse(inp[1]);
- decimal hours = decimal.Parse(inp[2]);
- decimal itemPrice = decimal.Parse(inp[3]);
- decimal EarnedMoney = 0m;
- if (day == "Feb")
- {
- EarnedMoney = 18 * (moneyPerHour * hours);
- }
- else if (day == "Jan" || day == "March" || day == "May" || day == "July" || day == "Aug" || day == "Oct" || day == "Dec")
- {
- EarnedMoney = 21 * (moneyPerHour * hours);
- }
- else
- {
- EarnedMoney = 20 * (moneyPerHour * hours);
- }
- if (EarnedMoney > 700)
- {
- EarnedMoney += EarnedMoney * 0.1m;
- }
- decimal diff = EarnedMoney -itemPrice;
- if (diff >=0)
- {
- Console.WriteLine("Money left = {0:F2} leva.",diff);
- }
- else
- {
- Console.WriteLine("Not enough money. {0:f2} leva needed.",itemPrice - EarnedMoney);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement