Question: Murachs java 6th edition.. please break down or highlight what belongs where. just needing a better visual understanding. The aume of a method or constrictior

The aume of a method or constrictior eombincal with the lint of porameter berhicuad a mothod of constructor by cosling different parameiner lists for - Whee coding a class, you can use the defis lieywind to refer to the current. object. Exercise.7-1 Modify the Product Viewer application This exercise guides you through the process af testing and modifying the Product Viewer application that's presented in this ebapter. Review and test the project 1. Open the project named chot_exi_Prixdact thas's in the ex_starts folder. Then. open the Product, ProductDB. and froduct, App classes and review their code. 2. Run the application and lest it with valind product codes like "java", "isp", and "mysql" to make sure this applicution works correctly. Then, teut it with an invalid code to see how that works. Modify the ProductDB class 3. In the ProductDB class, modify the if/else statement so it inchules another product. 4. Run the application and test it to make sure the new product code works. This shows that you can modify the code for a class without needing to modify the other classes that use it. Add a constructor to the Product class 5. In the Product class, add a constractor chat defines three parameters and uses them to set the values of the three instance variables. 6. In the ProductDB class, modify the code so it uses the new construetor to set the data in the Product object instead of using the setCode(). setDescription( and setPrice() methods. To do that, you can assign a new Product object to ti Product variable within each iffelse clause. 7. Run the application to make sure it still works correctly. Add a method to the Product class 8. In the Product class, add a method named getPriceNumberFormat) that returns the price with number formatting (not currency formatting). This method should return the number with 2 decimal places but no currency symbol. 9. In the ProdactApp class, modify the code sis it wes this method. 10. Run the application to make sure if stiil works correctly. Modify the ProductDB class 5 it defines an object 11. In the ProductDB class, modtfy the getProducti) method so it's an instance method instead of a static enetiod. 12. In the ProductApp class, modify the code so it creates a ProductDB object named db. Then, use this object to call the getProduct() method of the ProductDe class. 13. Rue the application to make sure it still works corrisctly
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
