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
Explain assemblies An assembly is a single deployable unit that having all the information about the implementation of : - classes - structures and - interfaces An

What is Unicode? In order to understand the concept of Unicode we require  to move a little back and understand the ANSI code. The ASCII (ask key) stands for American Standard

What is the difference between "DataSet" and "DataReader"? The major differences between "DataSet" and "DataReader" are as follows:- 1)The "DataSet" is a disconnected archit

How do we assign page specific attributes? The Page attributes are specified by using the @Page directive.

What is XML DOM? The DOM stands for Document Object Model, which explains the logical formation of documents and provides the way to access and manipulate a document. It suppli

SOAP Web Services A SOAP Web Service that supports three operations: add a bibliography entry, delete a bibliography entry and list all bibliography entries. You may design fo

how do I load txt file into listbox

I need a POS like openbravo Project Description: i want a POS like openbravo in .net with sql azure and c#. Must be designed also for touch screen.  Web platform Also m

CRM and Shaerpoint We are using 365+ CRM in the cloud for QuattroCitta at the moment which we will migrate to our own private cloud in six months (project part 2). Within ShareP

Write the basic syntax of a LINQ query in Visual Basic as well as in C#. In Visual Basic, the basic syntax of a LINQ query begins with the from clause and ends with the Select