Advertisement
dragonbs

PersonelTitles

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