Untitled

 avatar
unknown
plain_text
2 years ago
1.3 kB
10
Indexable
using System;

namespace LabPrgm05
{
    public class A
    {
        public string Name;
        public void GetName()
        {
            Console.WriteLine("Name;{0}",Name);
        }
    }
    public class B :A
    {
         public string Location;
        public void GetLocation()
        {
               Console.WriteLine("Location;{0}",Location);
        }
    }
    public class C :B
    {
        public int Age;
        public void GetAge()
        {
               Console.WriteLine("Age;{0}",Age);
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            C c = new C();
            Console.WriteLine("Entre the Cricketer details:");
            Console.WriteLine("Entre the Cricketer Name:");
            c.Name = Console.ReadLine();

            Console.WriteLine("Entre the Cricketer Location:");
            c.Location = Console.ReadLine();

            Console.WriteLine("Entre the Cricketer Age:");
            c.Age=int.Parse(Console.ReadLine());

            c.GetName();
            c.GetLocation();
            c.GetAge();

            Console.WriteLine("\nnPress Any key to exit..");
            Console.ReadLine();
        }
    }
}
Editor is loading...
Leave a Comment