Advertisement
tsvetelinapasheva

TsvetelinaPasheva/ConditionalStatementsAdvancedLab/04.PersonalTitles

Jan 24th, 2021
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp14
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.  
  10.            
  11.             double age = double.Parse(Console.ReadLine());
  12.             string gender = Console.ReadLine();
  13.  
  14.             if (gender == "m")
  15.             {
  16.                 if (age >= 16)
  17.                 {
  18.                     Console.WriteLine("Mr.");
  19.                 }
  20.                 else
  21.                 {
  22.                     Console.WriteLine("Master");
  23.                 }
  24.             }
  25.  
  26.             else if (gender == "f")
  27.             {
  28.                 if (age >= 16)
  29.                 {
  30.                     Console.WriteLine("Ms.");
  31.                 }
  32.                 else
  33.                 {
  34.                     Console.WriteLine("Miss");
  35.                 }
  36.             }
  37.  
  38.  
  39.  
  40.  
  41.  
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement