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
Describe the XmlWriter class. The XmlWriter class is used to write XML to a stream, a file, or a Textwriter object. This class works in a forward-only, non-cached manner. You c

What are standard query operators in LINQ? The standard query operators in LINQ are the extension process that forms the LINQ pattern. These operators form an API that enables

Net project Project Description: We want to make .net project Microsoft Active Directory, PMS Lync 2010 - 2013 databases creating a license key for their SW generati

How do we enable SQL Cache Dependency? Below are some of the steps to enable the SQL Cache Dependency:- Enable the notifications for database. Enable the notificatio


What are the features of ADO.Net ?  ADO.NET features: 1. Disconnected Data Architecture 2. Data cached in Datasets 3. Data transfer in XML format 4. Interaction wit

What is the use of the CommandBuilder class? The CommandBuilder class is used to automatically update a database according to the changes made in a DataSet. This class autom

The problem statement is pretty simple. We need a software implementation of a Point of Sale terminal at a typical store. The users of the system are the cashiers sitting at the sa

Project Description: Simple task on analysis svn and github .NET, PHP, Engineering, Software Architecture

Assembly: 1) Assembly is a unit of deployment such as EXE or a DLL. 2) An assembly consists one or more files (dlls, exe's, html files etc.),& represents a group of resources,