Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp42
- {
- class Program
- {
- static void Main(string[] args)
- {
- int purposeForDay = int.Parse(Console.ReadLine());
- string service = Console.ReadLine();
- int price = 0;
- double endSum = 0;
- while (service != "closed")
- {
- if (service == "haircut" )
- {
- string choice = Console.ReadLine();
- if (choice == "mens")
- {
- price = 15;
- }
- else if (choice == "ladies")
- {
- price = 20;
- }
- else if (choice == "kids")
- {
- price = 10;
- }
- }
- if (service == "color")
- {
- string choice = Console.ReadLine();
- if (choice == "touch up")
- {
- price = 20;
- }
- else if (choice == "full color")
- {
- price = 30;
- }
- }
- endSum += price;
- if (endSum >= purposeForDay)
- {
- break;
- }
- service = Console.ReadLine();
- }
- if (endSum >= purposeForDay)
- {
- Console.WriteLine("You have reached your target for the day!");
- }
- else if (endSum < purposeForDay)
- {
- Console.WriteLine($"Target not reached! You need {purposeForDay - endSum}lv. more.");
- }
- Console.WriteLine($"Earned money: {endSum}lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment