Question: this language is C# Please note that the numbers in the square brackets [] before the task you are required to do is the number

this language is C#

this language is C# Please note that the numbers in the square

brackets [] before the task you are required to do is the

number of points rewarded for the task if done correctly. The maximum

Please note that the numbers in the square brackets [] before the task you are required to do is the number of points rewarded for the task if done correctly. The maximum number of points is 25. [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 :int stockQuantity : int Properties + Name : string + set absent Price : double + set absent> SKU + StockQuantity int Methods + constructor Course (sku: int, stockQuantity: int, basePrice: double) + ToString() string 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 stockQuantity 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 for 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 ShoppingCart class Shopping Cart Class Fields cartValue : double Properties + set absent CartValue double + set absent Id : int + set absent> Products : List Methods + AddProduct (product: Product) :void + constructor Shopping Cart(id: int) + ToString() : string Create the following class members: [1] cartValue is a private field representing the total price of all products in the cart and it is based on the current price of the product at the time when it was added to the shopping cart. [1] CartValue is read only property providing the access to the cartValue field. [1] Id is a read only property representing cart id. [1] Products is read only property representing the list of products in the cart. You can create the list as you declare it or in the constructor. [1] A constructor that takes 1 parameter: cart id and assigns the values to appropriates property. [2] AddProduct method has one parameter: product object. The method will add the product to the list of products in the cart, and update the cart value. It also reduces added product stock quantity by 1. [2] ToString() method that generates the string with information about the cart. Make sure that your output matches the one that is provided in the output image of the console result down below. The output must be exactly as provided bellow: The output must be exactly as provided bellow: C. C:\WINDOWS\system32\cmd.exe Total cart 1 value is $1,131.00 with following products: 1 Ball 1 TV 1 Picture Total cart 2 value is $0.00 with following products: Total cart 1 value is $1,131.00 with following products: Ball 1 TV Picture Total cart 2 value is $1,132.00 with following products: Ball TV Picture 1 1 1 1 1 Press any key to continue IMPORTANT: Once you are done, paste the code for each one of the 2 classes you have created in the box below. No file upload is necessary

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!