Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace MethodsWithCases
- {
- class MethodsWithIFStatements
- {
- static void Main()
- {
- string text = Console.ReadLine().ToLower();
- PrintSpicies(text);
- }
- public static void PrintSpicies(string text)
- {
- if (text == "cat" || text == "dog")
- {
- Console.WriteLine("mammal");
- }
- else if(text == "snake" || text == "iguana" || text == "hameleon")
- {
- Console.WriteLine("Reptile");
- }
- else
- {
- Console.WriteLine("Unknown");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment