Define a class called Product that has: Read-only properties (you may use backing fields and properties or just auto

Class Definition: Define a class called Product that has:
 Read-only properties (you may use backing fields and properties or just auto-properties) for
ProductName (string) and PricePerUnit (double). These read-only properties are set when
each instance/object of the class is created and cannot be changed after that.
 In addition to these properties, there is a property called Quantity (int) that corresponds to
the number of units ordered for this particular product, which may be changed later.
 A property called ProductTotalBeforeTax (double) is a computed read-only property,
which will return the total before taxes for that product given PricePerUnit (double0 and
Quantity by multiplying the two properties.
 A property called ProductTax (double), which is a computed read-only property and
computed as 8% of the ProductTotalBeforeTax.
 Finally, another read-only computed property, ProductTotalAfterTax (double) is computed
as sum of ProductTotalBeforeTax and ProductTax.
The class must contain needed constructors, and an over-ridden ToString() method to display each
product details of ProductName, PricePerUnit, Quantity and ProductTotalBeforeTax, ProductTax,
ProductTotalAfterTax. You need to do background research and look up how to use String.Format()
method to return a formatted string instead of directly displaying the formatted string on the console

Main Program:
1. In the main method, create 3 instances or objects of Product by setting ProductName and
PricePerUnit for each of these objects to any name and unit price of your choice. Note that
the product names and corresponding price per unit for each of those three Product objects
are all your choice – e.g., ProductObject1 could have a ProductName “Disposable Masks
Pack” with PricePerUnit being $12.99 and so on). Note each of the three Product object
corresponds to three different product names, each with its own price per unit.
2. Then call the UpdateProductQty (see method definitions below) method three times each
time passing one of the three objects you have created. This method takes one Product
object as its parameter and updates the Quantity based on user input for that Product object
(e.g. method call for first Product object you have created would be
UpdateProductQty(product1)).
3. Once all product quantities have been updated, call the ChooseAction(product1, product2,
product3) method that is void returning and takes as input the three Product objects you have
created.
Method Definitions in the Main Program:
1. UpdateProductQty(Product anyProduct) static method in the main program: This is a
void method takes one Product object as its parameter and updates the Quantity based on
user input for that object.
a. This method displays the ProductName and Unit Price for that Product object and
prompts the user to enter number of units needed (product quantity) for that product.
b. Then, the Quantity of that Product object is updated based on user input (parse the
numeric input as needed). Note here that even though product1 is passed as an input
parameter, the Quantity for product1 can be updated inside the method because class
objects are reference data type, which means it is pass by reference by default.
2. ChooseAction(Product product1, Product product2, Product product3) static method
in the main program: This void method takes as input three Product objects as parameters.
It displays three action options for the user using a numbered input: Press 1 for View Cart,
Press 2 for Update Order and Press 3 for quitting the application.
a. When the user presses 1 (you need to get user input with Readline(), then parse it and
check if value == 1, note you need two == when checking if two values are equal in
an if statement), call the static method, ViewCart(product1, product2, product3)
that takes the three Product objects as arguments.
b. When the user presses 2, call UpdateCart(product1, product2, product3) method,
which also takes the three Product objects as parameters.
c. When the user presses 3, Clear your console output using Console.Clear( ) method,
and say “Thank you for placing an order with us. Good Bye!”.

3. ViewCart(Product product1, Product product2, Product product3) static method in
the main program: The ViewCart() void method takes the three Product objects as input
parameters:
a. Then, call the GetCartTotalsSummary(product1, product2, product3, out double
totalBeforeDiscount, out double discountAmount) to get the total of all three objects
before discount, total discount amount, and grand total after discount. See method
definition for GetCartTotalsSummary( ) below.
b. Display all the order details of the cart giving
i. each ProductName, PricePerUnit, Quantity, ProductTotalBeforeTax,
ProductTax, ProductTotalAfterTax. You can use ToString( ) method defined
in the class.
ii. totalBeforeDiscount, discount amount, and grand total after discount using an
output banner and formatted output.
iii. All monetary values must be formatted using the currency format specifier.
c. At the end of ViewCart() method, call the ChooseAction(product1, product2,
product3) method again to allow user to choose actions they want to take. Use some
form of formatted output to Display the results in a banner of your choice. You may
look up how to use String.Format( ) method to return a formatted string instead of
directly displaying the formatted string on the console.
4. GetCartTotalsSummary(Product product1, Product product2, Product product3, out
double totalBeforeDiscount, out double discountAmount) static method in the main
program that returns totalAfterDiscount: This method takes the three Product objects
and:
a. gets as out parameters the totalBeforeDiscount and discountAmount. The
totalBeforeDiscount is computed as sum of the ProductTotalAfterTax of the three
product objects. If the total amount before discount exceeds $100.00, then the
customer gets 10% off – the discountAmount is 10% of the totalBeforeDiscount.
b. returns as double the totalAfterDiscount (totalBeforeDiscount – discountAmount).
5. UpdateCart(Product product1, Product product2, Product product3) static method in
the main program: This method takes the three Product objects as input parameters.
a. It gives a number as options to update the quantities for each of the three product
names (e.g., Press 1 to update quantities for “Disposable Masks Pack”, 2 to update
quantities for <product name 2 – whatever name you choose>, and so on for the
three product names you chose).
b. Depending on what number the user has pressed, update the Quantity to the new
number the user has inputted for that product name (Product object), and display a
message saying quantities updated for that product.
c. Note that the user can only update quantities for one Product object at a time. At the
end of UpdateCart() method, call the ChooseAction(product1, product2, product3)
method again to allow user to choose actions they want to take.

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more