(Open in Desktop/Laptop/Big Screen  for better result.) 
Title: A) Design student class, marks class, inherits it in result class and access it using form. OR 
B) Create a console application for printing result. Create student class, inherit it in marks class, inherit marks class in result class. (multilevel inheritance).

Theory:

Explain inheritance and its types:

OPEN IMAGE IN NEW TAB FOR BEST RESULT


 1.Single inheritance: It is the type of inheritance in which there is one base class and one derived class.

Ex.

class A //base class
{
    public void eat()
    {
        returneating... ”;
    }
}

class B:A //derived class
{
    public void sleep()
    {
        returnsleeping... ”;
    }
}


2. Hierarchical inheritance: This is the type in which there are multiple classes derived from one base class. This type of inheritance is used when there is a requirement of one class feature that is needed in multiple classes.
Ex:
class A //base class
{
    public void eat()
    {
        returneating... ”;
    }
}

class B:A //derived class
{
    public void sleep()
    {
        returnsleeping... ”;
    }
}

class C:A
{
    public void drink ()
    {
        returndrinking....”;
    }
}


In the preceding program one base class is derived in many classes hence it is a called Hierarchical Inheritance.

3. Multilevel inheritance: When one class is derived from another class then this type of inheritance is called multilevel inheritance.
Ex:
class A //base class
{
    public void eat()
    {
        returneating... ”;
    }
}

class B:A //derived class
{
    public void sleep()
    {
        returnsleeping... ”;
    }
}

class C:B
{
public void drink ()
    {
        returndrinking....”;
    }
}


In this preceding program, each class is derived from one class that is derived from another class hence this type of inheritance is called Multilevel Inheritance.

4. Multiple inheritance (using interface): C# does not support multiple inheritance of classes. To overcome this problem we can use interfaces.
Ex:
interface a // Interface 1
{
    Void language();
}

interface b // Interface 2
{
    Void course();
}

public c : a,b {
    public void languages(){……}
    public void courses(){……}
}

Code / Program:

using  System;

namespace  Console_inheritance  {
class  Student
   {
    string  eno; string  name;

    public  Student()
    {
       eno  =  "NULL";
       name  =  "NULL";
    }

    public  Student (string  enroll,  string  rollno)
    {
       eno  =  enroll;
       name=  rollno;
    }

    public  void  show()
    {
        Console.WriteLine("Enrollment  number:"  +  eno);
        Console.WriteLine("Name  of  candidate:"  +  name);  
    }

class  Marks  :  Student
{
    int  sub1,  sub2,  sub3,  total;

    public  Marks()
    {
        total  =  0;
    }
 
 
public  Marks(string enroll,string rollno,int total1)
: base(enroll,rollno)
{
    total  =  total1;
    public  void  show()
    {
        base.show();
        Console.WriteLine("Total  Marks:"  +  total);
    }

    public  void  getdata()
    {
        sub1  =  Int32.Parse(Console.ReadLine());
        sub2  =  Int32.Parse(Console.ReadLine());
        sub3  =  Int32.Parse(Console.ReadLine());
    }

    public  void  calculate()
    {
        total  =  sub1  +  sub2+sub3;
    }
}

class  result  :  Marks
{
    int  percentage;
    public  result()
    {
    percentage  =  0;
    }

    public  result(string  enroll,  string  rollno,  
    int  total1,int  per):base(enroll, rollno,total1)
    {
    percentage  =  per;
    }

    public  void  show()
    {
        base.show(); Console.WriteLine("Percentage  you  got:"
          + percentage);
    }
}

class  Program
{
    static  void  Main(string[]  args)
    {
        m1.show();
    }
    result  m1  =  new  result("SS19CO055","Rizwan  Jamadar",90,85);
    Console.ReadKey();
}
}

Output:

OPEN IMAGE IN NEW TAB FOR BEST RESULT


 Conclusion:
In this experiment, we successfully learn types of inheritance in details and implement one type (multilevel inheritance) in this program.