Advertisement
knoteva

Untitled

Nov 3rd, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.18 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp5
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int questForDay = int.Parse(Console.ReadLine());
  14.             int earnForService = 0;
  15.             while (true)
  16.             {
  17.                 string serviceType = Console.ReadLine();
  18.  
  19.                 if (serviceType == "haircut")
  20.                 {
  21.                     string serviceOperation = Console.ReadLine();
  22.  
  23.                     switch (serviceOperation)
  24.                     {
  25.                         case "mens":
  26.                             earnForService += 15;
  27.                             break;
  28.                         case "ladies":
  29.                             earnForService += 20;
  30.                             break;
  31.                         case "kids":
  32.                             earnForService += 10;
  33.                             break;
  34.                     }
  35.                 }
  36.                 else if (serviceType == "color")
  37.                 {
  38.                     string serviceOperation = Console.ReadLine();
  39.  
  40.                     switch (serviceOperation)
  41.                     {
  42.                         case "touch up":
  43.                             earnForService += 20;
  44.                             break;
  45.                         case "full color":
  46.                             earnForService += 30;
  47.                             break;
  48.                     }
  49.                 }
  50.  
  51.                 if ((questForDay <= earnForService) || serviceType == "closed")
  52.                 {
  53.                     if (questForDay <= earnForService)
  54.                     {
  55.                         Console.WriteLine($"You have reached your target for the day!");
  56.                     }
  57.                     else
  58.                     {
  59.                         int notEnough = questForDay - earnForService;
  60.                         Console.WriteLine($"Target not reached! You need {notEnough}lv. more.");
  61.                     }
  62.                     Console.WriteLine($"Earned money: {earnForService}lv.");
  63.                 }
  64.             }
  65.  
  66.         }
  67.     }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement