Question: c sharp [2] Create a console application called CartDemo and add two classes in it: Product and ShoppingCart. You are provided with the content of



[2] Create a console application called "CartDemo" and add two classes in it: Product and ShoppingCart. You are provided with the content of the "Program.cs" file in the console application. Just click this link to download it. You must use it exactly as is. The class diagrams are shown below. Make sure that your classes conform to them exactly. [2] Create Product class. Product Class Fields basePrice double price double stock Quantity Properties :int + Name string + set absent Price double + set absent SKU int Stock Quantity int Methods + Constructors Coursesku: int, stock Quantity: int, basePrice: double) + ToString() : string Create the following class members: [1] base Price is a private read only field representing the base price of the product 111 price is the private field representing current product. It is the dependent on the stock quantity of the product. If the quantity is less then 1000 the current price is 110% of base price, otherwise it is equal to base price. [1] stockQuantity is private field representing the quantity of the product in stock i Stockmanistonestatus accorto stock mantity field Create the following class members: [1] basePrice is a private read only field representing the base price of the product [1] price is the private field representing current product. It is the dependent on the stock quantity of the product. If the quantity is less then 1000 the current price is 110% of base price, otherwise it is equal to base price. [1] stockQuantity is private field representing the quantity of the product in stock [3] StockQuantity is property that is accessor to stock Quantity field. [1] Name is property representing the name of the product. [1] SKU is read only property representing the stock keep number of the product. [1] Price is read only property that is accessor fol price field. [2] A constructor with three parameters: SKU number, number of products in stock, and base price. It assigns them to appropriate members. [1] Create Shopping Cart class Shopping Cart Class Fields cartValue : double Properties + set absent CartValue : double + set absents Id int + set absents Products : List
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
