Question: convert following python code to C# 11 1 class Toy: 2 def init_(self, topy_id, toy_type, price): 3 self.toy_id=toy_id 4 self.toy_type=toy_type 5 self.price=price I 6 self.Discount_Applicable=0

convert following python code to C#
convert following python code to C# 11 1 class Toy: 2 def
init_(self, topy_id, toy_type, price): 3 self.toy_id=toy_id 4 self.toy_type=toy_type 5 self.price=price I 6

11 1 class Toy: 2 def init_(self, topy_id, toy_type, price): 3 self.toy_id=toy_id 4 self.toy_type=toy_type 5 self.price=price I 6 self.Discount_Applicable=0 7 class store: 8 def _init_(self, toy_list, discount_details): 9 self.toy_list=toy_list 10 self.dicount_details=discount_details def calculate_discount(self): 12 for i in toy_list: 13 if i.toy_type in self.discount_details.keys(): 14 s=self.discount_details[toy_type] 15 i.Discount_Applicable=i.price*(s/100) 16 else: 17 i.Discount_Applicable=i.price 18 nrint(input()) 19 toy_list=[] 20 k={} 21 for i in range(n): tow id-intlinnut 3 g=seITUISCOUNT_eldis Coy_ypes i. Discount_Applicable=i.price*($/100) else: i. Discount_Applicable=i.price n=int(input()) toy_list=[] for i in range(n): I toy_id=int(input()) toy_type=input() toy_price=int(input()) 5 toy_list.append(Toy(toy_id, toy_type, toy_price)) 5 for i in range(3): key=input() value=int(input()) k[key]=value d=store/toy_list,k) 1 d.calculate_discount() 2 for i in toy_list: print(i.toy_id) 4 print(i..toy price) 55 print(i.toy_Discount_Applicable) 7 8 -3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!