give me a correctly answer

give me a correctly answer
1.Tim has developed a Generic class Items which he can use to store several types of information about an Item.Help Tim to store information about an Item :
i.Item Name =”Burger”
ii.Item Price=10 RMB
iii.Weight =100 grams
iv.Manufacturer’s Address= “McDonald”
The Generic class is written below,you need to add statements into Main ( ) method to store information and display stored information about an Items.
class Itmes
{
private T ob
public T value
{
get
{
return this.ob;
}
set
{
this.ob = value;
}
}
}
class Program
{
static void Main(string[] args)
{
_______________________________________________________________
_______________________________________________________________
_______________________________________________________________
_______________________________________________________________
}
}
到此一游ABC 1年前 已收到1个回答 举报

印象天 花朵

共回答了14个问题采纳率:85.7% 举报

class Program
{
static void Main(string[] args)
{
Itmes name = new Itmes();
name.value ="Burger";
Itmes price = new Itmes();
price.value = 10;
Itmes Weight = new Itmes();
Weight.value = 100;
Itmes Address = new Itmes();
Address.value = "McDonald";
Console.WriteLine("Name:" + name.value);
Console.WriteLine("Price:" + price.value);
Console.WriteLine("Weight :" + Weight.value);
Console.WriteLine("Manufacturer's Address:" + Address.value);
Console.Read();
}
}
Hope it helps to you

1年前

1
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 17 q. 0.574 s. - webmaster@yulucn.com