CS411 Assignment 1 Solution File
CS411 Assignment 1 Solution File
Assignment No. 01
Semester: Spring 2025
BC220400854
using System;
namespace PaintingManagementSystem
{
// Base class
class Shape
{
public virtual void Display()
{
Console.WriteLine("I am a generic shape.");
}
}
// Derived class: Circle
class Circle : Shape
{
public override void Display()
{
Console.WriteLine("I am a circle shape.");
}
}
class Program
{
static void Main(string[] args)
{
Console.WriteLine("My student Id is BC220400854\n");
// Demonstrating polymorphism
foreach (Shape shape in shapes)
{
shape.Display();
}
}
}
}