Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PART A PART B You will be writing 3 methods for this question: (3) 1 - Write a method that takes a double value representing
PART A
PART B
You will be writing 3 methods for this question: (3) 1 - Write a method that takes a double value representing the temperature in Celsius and returns the temperature in Fahrenheit. F = (9/5 *C) + 32 . [3] 2 - Write a second method that takes a double value representing the temperature in Kelvin and returns the temperature in Celsius. K = C + 273.15 . [3] 3 - Write a third method that takes a double value representing the temperature in Kelvin and returns the temperature in Fahrenheit. For this method you must invoke the two previous methods appropriately. Don't duplicate code that has been written before. . [1] 4 - Write the code statements that you would add inside the Main() method to invoke the third method and display the argument and the return value. IMPORTANT: You must paste in the box below your coding answer to each of the 4 items above. 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 + aset absent> CartValue : double + eset absent) Id int + eset absent Products : List Product> Methods + AddProduct(product: Product) :void + aconstructors ShoppingCart(id: int) + ToString() string Create the following class members: 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: ERSCHWINDOWS\system.cmd.exe Total cart 1 value is $1,131.ee 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: 1 Ball 1 TV 1 Picture Total cart 2 value is $1,132.00 with following products: 1 Ball 1 TV 1 Picture Press any key to continueStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started