Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _02.DreamItem
- {
- class DreamItem
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- string[] splitInput = input.Split('\\');
- string month = splitInput[0];
- decimal moneyPerHour = Convert.ToDecimal(splitInput[1]);
- decimal hoursPerDay = Convert.ToDecimal(splitInput[2]);
- decimal itemPrize = Convert.ToDecimal(splitInput[3]);
- int deysInMonth = 0;
- switch (month)
- {
- case "Jan": deysInMonth = 31; break;
- case "Feb": deysInMonth = 28; break;
- case "Mar": deysInMonth = 31; break;
- case "Apr": deysInMonth = 30; break;
- case "May": deysInMonth = 31; break;
- case "June": deysInMonth = 30; break;
- case "July": deysInMonth = 31; break;
- case "Aug": deysInMonth = 31; break;
- case "Sept": deysInMonth = 30; break;
- case "Oct": deysInMonth = 31; break;
- case "Nov": deysInMonth = 30; break;
- case "Dec": deysInMonth = 31; break;
- }
- decimal deysWorking = deysInMonth - 10;
- decimal sellary = deysWorking * moneyPerHour * hoursPerDay;
- if (sellary > 700)
- {
- sellary += sellary * 0.1M;//sellary + ((sellary * 10) / 100);
- }
- decimal totalMoney = sellary - itemPrize;
- if (totalMoney >= 0)
- {
- Console.WriteLine("Money left = {0:F2} leva.", Math.Abs(sellary - itemPrize));
- }
- else
- {
- Console.WriteLine("Not enough money. {0:F2} leva needed.", Math.Abs(sellary - itemPrize));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment