VelizarAvramov

05. Foreign Languages

Jul 17th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. Write a program, which prints the language, that a given country speaks. You can receive only the following combinations: English is spoken in England and USA; Spanish is spoken in Spain, Argentina and Mexico; for the others, we should print "unknown".
  2. using System;
  3.  
  4. namespace _05._Foreign_Languages
  5. {
  6.     class ForeignnLanguages
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             string country = Console.ReadLine();
  11.  
  12.             switch (country)
  13.             {
  14.                 case "England":
  15.                 case "USA":
  16.                     Console.WriteLine("English");
  17.                     break;
  18.                 case "Spain":
  19.                 case "Argentina":
  20.                 case "Mexico":
  21.                     Console.WriteLine("Spanish");
  22.                     break;
  23.  
  24.                 default:
  25.                     Console.WriteLine("unknown");
  26.                     break;
  27.             }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment