63 775
Assignments Done
99,3%
Successfully Done
In August 2018

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
Expert's answer
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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions