Accepting a list of 5 items - c# program, DOT NET Programming

Accepting a List of 5 Items - C# Program

Hello, I've been trying so many codes for this but those codes didn't work well. Please write the code for Accepting a List of 5 Items in c#.

 

Posted Date: 2/12/2013 1:17:44 AM | Location : United States





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();

 }

}

Posted by diana | Posted Date: 2/12/2013 1:20:37 AM

Thanks for helping me in my assignment.

Posted by Aana | Posted Date: 2/12/2013 1:22:59 AM


Related Discussions:- Accepting a list of 5 items - c# program, Assignment Help, Ask Question on Accepting a list of 5 items - c# program, Get Answer, Expert's Help, Accepting a list of 5 items - c# program Discussions

Write discussion on Accepting a list of 5 items - c# program
Your posts are moderated
Related Questions
Web Developer Project Description: We need of an expert web developer for long term association, please apply with models if you have the subsequent skills: ASP.NET MVC 3

What is ViewState? The Viewstate is built-in structure for automatically retaining the values among the multiple requests for the similar page. The viewstate is internally main

What is a Hash Table? You can access an array using the INDEX value of that array, but how many times you know the real value of the index. The Hashtable provides a way of acce

Project Description: Looking for a developer who will develop a web portal like zulutrade, some features will be taken from signaltrader The changes would be like: 1) Only

Develop Outlook Add-In for all versions I need simple code for Outlook(express,2003,2007,2010,2013) Add-In with functionality to repeatedly send CC to the specified email(s), th

What are the methods provided by the command object? The command objects used to connect the connection object to the Datareader or the dataset. The command object provided som

What are major difference between classic ADO and ADO.NET? Following are some major differences among both In ADO we have recordset and in ADO.NET we have dataset. In rec

How would ASP and ASP.NET apps run at the same time on the same server? Both ASP and ASP.net can be run at similar server, becuase IIS has the capability to respond/serve both

What are the ways to implement locking in ADO.NET? There are many ways to implement locking using ADO.NET which are shown below:- 1)Whenever we call "Update" method of DataA

Describe the three levels of data abstraction? The are three levels of abstraction: Physical level: The lowest level of abstraction explains how data are stored.  Logical