Question: Murachs java 6th edition.. please break down or highlight what belongs where. just needing a better visual understanding. nhis ctercise guides you through the proceit
nhis ctercise guides you through the proceit of exverting an Area and Create and use an object 1. Open the project named cho7 en3 AreaAnatPerinceler thar's wiored in the: 2. Create a class named Rectangle and store it in the same puckage as the 3. In the Rectangle class, add instance variables for length and width. Then, cole the get and set methods for these instasce variables. If possible, use your tDE 4. Add a constructor with no parameters thar initializes the length and width to 0 . 5. Add a get method that calculates the area of the rectangle and renims a double value for the result. If you want, you can copy the code that performs this calculation from the AreaAndPerimeterApp class. 6. Add a get method that returns the area as a String object with standard numeric formatting and a minimam of three decimal plices. To make it easy. to refer to the NumberFormat class, yoe should add an import staterent for it. 7. Repeat the previous two steps for the perimeter. 8. In the Area AndPerimeterApp class, add code that creates a Rectangle object and sets its length and width. 9. Modify the code that displays the calcularions so it uses the methods of the Rectangle object to get the area and perimeter of the rectangle. 10. Remove any Jeftover code from the AreaAndPerinseterApp class, includiag any unnecessary import statements. 11. Run the application and test it with valid data. It should calculate the area and perimeter for a rectangle. Overload the constructor 12. In the Rectangle class, overload the constructor by adding a second constructor that accepts two parameters: length and width. This constructor should set the length and width of the rectangle to the values supplied by these parameters. 13. In the AreaAndPerimeter App class, modify the code so it uses the new constructor instead of the constructor with no parameters. 14. Run the application and test it to make sure it still works correctly
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
