using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UseInheritanceParrotKiwisMousebird {
public class parrots {
int weight, length, height;
string colour;
public void details(string colour, int weight, int length, int height) {
this.colour = colour;
this.weight = weight;
this.length = length;
this.height = height;
Console.WriteLine("\ncolour : " + colour);
Console.WriteLine("weight : " + weight + " gm");
Console.WriteLine("length : " + length + " cm");
Console.WriteLine("height : " + height + " cm");
}
}
public class kiwi: parrots {}
public class mousebird: kiwi {}
class Program {
static void Main(string[] args) {
Console.WriteLine("PARROTS");
parrots pr = new parrots();
pr.details("red", 200, 8, 4);
Console.WriteLine("\n\nKIWI");
kiwi kw = new kiwi();
kw.details("yellow", 230, 10, 8);
Console.WriteLine("\n\nMOUSEBIRD");
mousebird mb = new mousebird();
mb.details("blue", 250, 14, 8);
Console.ReadLine();
}
}
}OutputPARROTS
colour :red
weight :200 gm
length :8 cm
height :4 cm
KIWI
colour : yellow
weight : 230 gm
length : 10 cm
height : 8 cm
MOUSEBIRD
colour : blue
weight : 250 gm
length : 14 cm
height : 8cm
