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
Requirements: 1.  Complete the following two exercises by developing working csharp projects. 2.  Write a report to explain csharp code written in the projects. 3.  Submi

What are the different levels Of IIS isolation?  The IIS consist of 3 level of isolation as shown below:- LOW (IIS process):- In this type of isolation the main IIS proc

What do you mean by data encapsulation? Data encapsulation is a method of binding data and code in single unit known as object and hiding all the implementation details of a cl

Question: (a) Outline four classes that allow you to work with File Streams. (b) (i) What potential problem can arise when you change items stored in an Application State

Printing Triangles - C# Program I need program code for Printing Triangles in C#. Can anybody send me there ideas?


What is the difference between Convert.toString and .toString() method To know the difference between Convert.toString and .toString() see the below code : int i =0; Mess

Passport Authentication This is a centralized authentication service given by Microsoft that offers a single logon facility and membership services for participating sites. ASP

Question: (a) One of the advantages of the Session object is that it prompts to you when a user session begins. In this context, a user fills in a registration form and the Se

I have a code in C# which uses Microsoft Solver Foundation to solve linear programming model. But the problem is the code is too long, there are too many variables and constraints,