Answer to Question #42767 in C# for priya

Question #42767
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
1
Expert's answer
2014-05-28T09:51:52-0400
using System;
usingSystem.Collections.Generic;
using System.Linq;
usingSystem.Text;

namespaceConsoleApplication13
{
enum ItemCategory {Women, Men, Girls, Boys,Babies }
class Category
{
ItemCategoryIC;
public string name;
public int number_of_units;
public double unit_price;
publicCategory(ItemCategory x, string y, int z, double k) { name = y; number_of_units = z; unit_price= k; IC = x; }
public void ShowInfo()
{ Console.WriteLine("item category is : " + IC + ";\n item name : " + name + ";\n number of units : " +number_of_units + ";\n unit price : "+unit_price+"."); }
}
class Program
{
static void Main()
{
Categoryt = new Category(ItemCategory.Girls,"toys",5,2.5);
t.ShowInfo();

Console.ReadLine();
}
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS