using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication20
{
class Program
{
static void Main(string[] args)
{
int a,i;
Console.WriteLine("enter the number of players");
a=Convert.ToInt32(Console.ReadLine());
string[] arr= new string [a];
for(i=0;i<a;i++)
{
arr[i]=Console.ReadLine();
}
for (i = 0; i < a; i++)
{
Console.WriteLine("name of player:" + arr[i]);
}
Console.ReadLine();
}
}
}
Ankitware is a platform where you get NIIT dumps fully solved!!!!! NIIT Lab At Home ; NIIT Pmr ,NIIT cycle test, Window app. Contact:ankitware@gmail.com.
Showing posts with label C# LAB at HoM 10. Show all posts
Showing posts with label C# LAB at HoM 10. Show all posts
Saturday, 27 April 2013
jhon wants to enter player name (range int 1 to 4)
Thursday, 25 April 2013
David needs to create a program to maintain the details of the stock of a shop. He needs to ensure that item category is Women, Men, Girls, Boys, and Babies. He needs to accept item category from the user. In addition, he needs to accept item name, number of units, and unit price. Finally, he needs to display all the details.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication27
{
class shop
{
string item;
int up, total, unit;
public void accept()
{
Console.WriteLine("Enter the item name:");
item = Convert.ToString(Console.ReadLine());
Console.WriteLine("Enter units of item:");
unit = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the unnit price:");
up = Convert.ToInt32(Console.ReadLine());
}
}
class Program
{
static void Main(string[] args)
{
string cat;
shop s = new shop();
Console.WriteLine("Enter the catagory:");
cat = Convert.ToString(Console.ReadLine());
switch (cat)
{
case "women":
s.accept();
break;
case "men":
s.accept();
break;
case "girls":
s.accept();
break;
case "boys":
s.accept();
break;
case "babies":
s.accept();
break;
default:
Console.WriteLine("Invalid Selection");
break;
}
Console.ReadLine();
}
}
}
Subscribe to:
Posts (Atom)
-
Contact : 8467922888
-
Niit NIIT NIIT D C Chowk New Delhi 1800 102 6448 CALL DIRECTIONS NIIT NIIT HD-7, 2nd Floor, Main Metro Road, Opp. Metro Pillar No....