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
What is .NET Remoting? The .NET remoting is replacement of DCOM. Using .NET remoting you can make remote object calls that lie on different Application Domains. since the remot

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

I want Web Social Apps/ site Project Description: I need a web designer have a specific unique project in mind.  Skills required are C# Programming, Cocoa, Mac OS, iPhone,

A Super-hero SharePoint developer with great design skills Project Description: US: Our start-up company prepares a very innovative and cool SharePoint related product with c

What are the different types of replication supported by SQL SERVER? There are 3  types of replication supported by SQL SERVER which are shown below:- 1) Snapshot Replicati

Jquery and MVC 4.5 Training Session I am looking who have industry experience working on Microsoft Technology ( MVC 4.5 ) and Jquery, who will take live online session and provi

Project Description: I have a basic C# control interface that I want to be accessed remotely. Possible implementation using wrappers. Skills required are C# Programming, Webs

What is Reference counting in COM? The Reference counting is a memory management method used to count the number of times an object has a pointer referring to it. The very firs

Project Description: Section - Mobile Data Collection System Using the Microsoft Mobile .Net Framework or .Net Compact Framework and ASP.NET web technology develop a mobile d

Project Description: We are looking for same usability/options of coachup.com thus, we will have different own UI design. Conditions: State your price and please describe/