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 IUKNOWN interface All COM object supports atleast one interface, that is  IUnknown interface. All interfaces are the classes, derived from the base class IUnknown. Eve

Project Description: This project uses Microsoft Visual Studio 2010/2012, Internet Information Services (IIS) Manager and Microsoft SQL Server Management Studio. It is a Mobi

What is event bubbling? The Server controls such as  DataList, Datagrid,  Repeater can have another child controls inside them. For example the DataGrid can have combo box ins

Print Triangle in Reverse Pattern - C# Program Need the code of C# Program for Print Triangle in Reverse Pattern.

What are benefits and limitations of using Cookies? The benefits of using cookies for state management are as follows:- 1)    There is no server resources required as they a

Explain different software development life cycles. The System Development Life Cycle (SDLC) is the overall process of developing information systems through multi stage proces

Automate installation setup Project Description: The steps are: Clicking four times accept and the setup goes to tray, I do not want to block the mouse or the keyboard. Sk

Generate Function to Create Signed_Body for Instagram Project Description: I want the exact Signed_Body for Instagram The only difference is that I want the most recent ve

What are value types and reference types?  Value type - bool, byte, chat, decimal, double, enum , float, int, long, sbyte, short, strut, uint, ulong, ushort. Value types are

We want help in ASP.NET MVC Developer I want an expert ASP.NET MVC, C#,LINQ, SQL Server2012, JQuery, Angular JS, Bootstrap Responsive UI developer for more 6+ months. Desired