Program code for Accepting a List of 5 Items, implement it
using System;
using System.Collections;
class ShoppingList
{
public static void Main(string []args)
{
ArrayList n = new ArrayList ();
n.Add(args[0]);
n.Add(args[1]);
n.Add(args[2]);
n.Add(args[3]);
n.Add(args[4]);
n.Sort();
Console.WriteLine ("The items in the Shopping List are : ");
for (int i =0; i< nCount; i++)
{
Console.WriteLine((i+1) + " " +n[i]);
}
Console.WriteLine();
n.Remove(2); // Deletes an item frm list
n.Add(3) = "Daljit"; // Adds an item in the list
n.Add(5) = "End"; // Adds in the end of the list
Console.WriteLine ("The items in the Shopping List After modifying are : ");
for (int i =0; i< nCount; i++)
{
Console.WriteLine((i+1) + " " +n[i]);
}
Console.ReadLine();
}
}