Advertisement
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 ConsoleApp5
- {
- class Program
- {
- static void Main(string[] args)
- {
- int questForDay = int.Parse(Console.ReadLine());
- int earnForService = 0;
- while (true)
- {
- string serviceType = Console.ReadLine();
- if (serviceType == "haircut")
- {
- string serviceOperation = Console.ReadLine();
- switch (serviceOperation)
- {
- case "mens":
- earnForService += 15;
- break;
- case "ladies":
- earnForService += 20;
- break;
- case "kids":
- earnForService += 10;
- break;
- }
- }
- else if (serviceType == "color")
- {
- string serviceOperation = Console.ReadLine();
- switch (serviceOperation)
- {
- case "touch up":
- earnForService += 20;
- break;
- case "full color":
- earnForService += 30;
- break;
- }
- }
- if ((questForDay <= earnForService) || serviceType == "closed")
- {
- if (questForDay <= earnForService)
- {
- Console.WriteLine($"You have reached your target for the day!");
- }
- else
- {
- int notEnough = questForDay - earnForService;
- Console.WriteLine($"Target not reached! You need {notEnough}lv. more.");
- }
- Console.WriteLine($"Earned money: {earnForService}lv.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement