Dianov

Conditional Statements Advanced - Lab (03. Animal Type)

Nov 1st, 2020
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace AnimalType
  8. {
  9.     class Program
  10.     {
  11.         public static void Main()
  12.         {
  13.             string animal = Console.ReadLine();
  14.             switch (animal)
  15.             {
  16.                 case "dog":
  17.                     Console.WriteLine("mammal");
  18.                     break;
  19.                 case "crocodile":
  20.                 case "tortoise":
  21.                 case "snake":
  22.                     Console.WriteLine("reptile");
  23.                     break;
  24.                 default:
  25.                     Console.WriteLine("unknown");
  26.                     break;
  27.             }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment