Question: Implement class design: Product and TestProduct You will create the Product class and run with the test program. This class must implement the model in
Implement class design: Product and TestProduct
You will create the Product class and run with the test program. This class must implement the model in the following UML class diagram.

1. declare class fields to store the product name, price, product ID and total number of products; 2. implement a constructor that takes two parameters that populates the name and price fields; the variable total is incremented by one; the productID is populated by the current value of total; 3. implement a method getName that retrieves the product name; 4. implement a method getProductID that retrieves the product ID; 5. implement a method getPrice that retrieves the product price; 6. implement a method changePrice that changes the product price to the new price received as a parameter; 7. implement a method getTotal that retrieves the total number of products.
Design class TestProduct. Compile and run TestProduct program. You should have the following output:

Just need it done simple and to what the instructions ask :) No need for anything different or out of the ordinary, thanks in advance :)
Product -name: String price: double -productID: int total: int +Product (String, double) +getName ): string +getProductID () : int +getPrice ) :double +changePrice (double) : void +getTotal ): int
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
