VelizarAvramov

01. Choose a Drink

Jul 17th, 2018
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1. Write a program, which receives a profession (as a string) and chooses the perfect drink for the person. The possible combinations are:
  2. • “Water” – for “Athlete”
  3. • “Coffee” – for “Businessman” or “Businesswoman”
  4. • “Beer” – for “SoftUni Student”
  5. • “Tea” – for all other professions.
  6. using System;
  7.  
  8. namespace _01._Choose_a_Drink
  9. {
  10.     class ChooseDrink
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             string profession = Console.ReadLine();
  15.  
  16.             if (profession == "Athlete")
  17.             {
  18.                 Console.WriteLine("Water");
  19.             }
  20.             else if (profession == "Businessman" || profession == "Businesswoman")
  21.             {
  22.                 Console.WriteLine("Coffee");
  23.             }
  24.             else if (profession == "SoftUni Student")
  25.             {
  26.                 Console.WriteLine("Beer");
  27.             }
  28.             else
  29.             {
  30.                 Console.WriteLine("Tea");
  31.             }
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment