using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication3
{
class items
{
public string[] itemname = new string[100];
public int[] units = new int[100];
public int[] unitprice = new int[100];
public int index;
public items()
{
index = 0;
}
}
class stockmanagement
{
static void Main(string[] args)
{
items men = new items();
items women = new items();
items child = new items();
items boys = new items();
items girls = new items();
int choice;
do
{
Console.WriteLine("Enter the Category:\n1.Men\n2.Women\n3.Boys\n4.Girls\n5.Child");
int ch = Convert.ToInt16(Console.ReadLine());
switch (ch)
{
case 1:
Console.WriteLine("Enter The ItemName:");
men.itemname[men.index] = Console.ReadLine();
Console.WriteLine("Enter The no. of units:");
men.units[men.index] = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter The no. of unitprice:");
men.unitprice[men.index] = Convert.ToInt16(Console.ReadLine());
men.index++;
break;
case 2:
Console.WriteLine("Enter The ItemName:");
women.itemname[women.index] = Console.ReadLine();
Console.WriteLine("Enter The no. of units:");
women.units[women.index] = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter The no. of unitprice:");
women.unitprice[women.index] = Convert.ToInt16(Console.ReadLine());
women.index++;
break;
case 3:
Console.WriteLine("Enter The ItemName:");
boys.itemname[boys.index] = Console.ReadLine();
Console.WriteLine("Enter The no. of units:");
boys.units[boys.index] = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter The no. of unitprice:");
boys.unitprice[boys.index] = Convert.ToInt16(Console.ReadLine());
boys.index++;
break;
case 4:
Console.WriteLine("Enter The ItemName:");
girls.itemname[girls.index] = Console.ReadLine();
Console.WriteLine("Enter The no. of units:");
girls.units[girls.index] = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter The no. of unitprice:");
girls.unitprice[girls.index] = Convert.ToInt16(Console.ReadLine());
girls.index++;
break;
case 5:
Console.WriteLine("Enter The ItemName:");
child.itemname[child.index] = Console.ReadLine();
Console.WriteLine("Enter The no. of units:");
child.units[child.index] = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter The no. of unitprice:");
child.unitprice[child.index] = Convert.ToInt16(Console.ReadLine());
child.index++;
break;
}
Console.WriteLine("enter 1 to continue adding");
choice = Convert.ToInt16(Console.ReadLine());
} while (choice == 1);
Console.WriteLine("\n\n\n");
Console.WriteLine("The Stocks are:\n men:");
for (int i = 0; i < men.index; i++)
Console.WriteLine("ItemName: " + men.itemname[i] + " units :" + men.units[i] + " untprice: " + men.unitprice[i]);
Console.WriteLine("\n\n\n");
Console.WriteLine("The Stocks are:\n Women:");
for (int i = 0; i < women.index; i++)
Console.WriteLine("ItemName: " + women.itemname[i] + " units :" + women.units[i] + " untprice: " + women.unitprice[i]+"\n");
Console.WriteLine("\n\n\n");
Console.WriteLine("The Stocks are:\n Boys:");
for (int i = 0; i < boys.index; i++)
Console.WriteLine("ItemName: " + boys.itemname[i] + " units :" + boys.units[i] + " untprice: " + boys.unitprice[i]+"\n");
Console.WriteLine("\n\n\n");
Console.WriteLine("The Stocks are:\n girls:");
for (int i = 0; i < girls.index; i++)
Console.WriteLine("ItemName: " + girls.itemname[i] + " units :" + girls.units[i] + " untprice: " + girls.unitprice[i]+"\n");
Console.WriteLine("\n\n\n");
Console.WriteLine("The Stocks are:\n child:");
for (int i = 0; i < child.index; i++)
Console.WriteLine("ItemName: " + child.itemname[i] + " units :" + child.units[i] + " untprice: " + child.unitprice[i]+"\n");
Console.WriteLine("\n\n\n");
Console.ReadLine();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication3
{
class items
{
public string[] itemname = new string[100];
public int[] units = new int[100];
public int[] unitprice = new int[100];
public int index;
public items()
{
index = 0;
}
}
class stockmanagement
{
static void Main(string[] args)
{
items men = new items();
items women = new items();
items child = new items();
items boys = new items();
items girls = new items();
int choice;
do
{
Console.WriteLine("Enter the Category:\n1.Men\n2.Women\n3.Boys\n4.Girls\n5.Child");
int ch = Convert.ToInt16(Console.ReadLine());
switch (ch)
{
case 1:
Console.WriteLine("Enter The ItemName:");
men.itemname[men.index] = Console.ReadLine();
Console.WriteLine("Enter The no. of units:");
men.units[men.index] = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter The no. of unitprice:");
men.unitprice[men.index] = Convert.ToInt16(Console.ReadLine());
men.index++;
break;
case 2:
Console.WriteLine("Enter The ItemName:");
women.itemname[women.index] = Console.ReadLine();
Console.WriteLine("Enter The no. of units:");
women.units[women.index] = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter The no. of unitprice:");
women.unitprice[women.index] = Convert.ToInt16(Console.ReadLine());
women.index++;
break;
case 3:
Console.WriteLine("Enter The ItemName:");
boys.itemname[boys.index] = Console.ReadLine();
Console.WriteLine("Enter The no. of units:");
boys.units[boys.index] = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter The no. of unitprice:");
boys.unitprice[boys.index] = Convert.ToInt16(Console.ReadLine());
boys.index++;
break;
case 4:
Console.WriteLine("Enter The ItemName:");
girls.itemname[girls.index] = Console.ReadLine();
Console.WriteLine("Enter The no. of units:");
girls.units[girls.index] = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter The no. of unitprice:");
girls.unitprice[girls.index] = Convert.ToInt16(Console.ReadLine());
girls.index++;
break;
case 5:
Console.WriteLine("Enter The ItemName:");
child.itemname[child.index] = Console.ReadLine();
Console.WriteLine("Enter The no. of units:");
child.units[child.index] = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter The no. of unitprice:");
child.unitprice[child.index] = Convert.ToInt16(Console.ReadLine());
child.index++;
break;
}
Console.WriteLine("enter 1 to continue adding");
choice = Convert.ToInt16(Console.ReadLine());
} while (choice == 1);
Console.WriteLine("\n\n\n");
Console.WriteLine("The Stocks are:\n men:");
for (int i = 0; i < men.index; i++)
Console.WriteLine("ItemName: " + men.itemname[i] + " units :" + men.units[i] + " untprice: " + men.unitprice[i]);
Console.WriteLine("\n\n\n");
Console.WriteLine("The Stocks are:\n Women:");
for (int i = 0; i < women.index; i++)
Console.WriteLine("ItemName: " + women.itemname[i] + " units :" + women.units[i] + " untprice: " + women.unitprice[i]+"\n");
Console.WriteLine("\n\n\n");
Console.WriteLine("The Stocks are:\n Boys:");
for (int i = 0; i < boys.index; i++)
Console.WriteLine("ItemName: " + boys.itemname[i] + " units :" + boys.units[i] + " untprice: " + boys.unitprice[i]+"\n");
Console.WriteLine("\n\n\n");
Console.WriteLine("The Stocks are:\n girls:");
for (int i = 0; i < girls.index; i++)
Console.WriteLine("ItemName: " + girls.itemname[i] + " units :" + girls.units[i] + " untprice: " + girls.unitprice[i]+"\n");
Console.WriteLine("\n\n\n");
Console.WriteLine("The Stocks are:\n child:");
for (int i = 0; i < child.index; i++)
Console.WriteLine("ItemName: " + child.itemname[i] + " units :" + child.units[i] + " untprice: " + child.unitprice[i]+"\n");
Console.WriteLine("\n\n\n");
Console.ReadLine();
}
}
}
No comments:
Post a Comment