public Product(string name, int price)
public virtual string description()
public Book(string name, int price)
public override string description()
return "[Book]" + name + "(RM. "+ price +")";
public Clothes(string name, int price)
public override string description()
return "[Clothes]" + name + "(RM. "+ price +")";
public static void Main(){
Product[] arr = new Product[1000];
Console.WriteLine("1.Add a book 2. Add a clothes 3.Change Name 4.Change Price 5.Description");
int cmd = Convert.ToInt32(Console.ReadLine());
arr[cnt_arr++] = new Book("[No Name", 0);
arr[cnt_arr++] = new Clothes("[No clothes", 0);
Console.WriteLine("ID:");
int id3 = Convert.ToInt32(Console.ReadLine());
string name = Console.ReadLine();
Console.WriteLine("ID:");
int id4 = Convert.ToInt32(Console.ReadLine());
int price = Convert.ToInt32(Console.ReadLine());
for (int i = 0; i< cnt_arr ;i++)
Console.WriteLine(arr[i].description());