repl.it
@kironroy/

catextensionmethods

C#

Person model with extension methods

fork
loading
Files
  • main.cs
  • CatModel.cs
  • ConsoleStuff.cs
  • main.exe
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;

namespace ExtensionMethods
{
    class Program
    {
        static void Main(string[] args)
        {
            CatModel cat = new CatModel();
            
            Console.WriteLine(); // breakline

            cat.CatsName = "What is your cat's name: ".ToLower().RequestAString();

            cat.CatType = "What type cat is it: ".RequestAString();

            cat.CatAge = "What is your cat's age: ".RequestAnInt(1, 112);

            cat.CatInfoPrint();

            Console.ReadLine();
        }
    }
}