Question: This is for my intoduction for programming class. Having problem with this and would love if someone could solve. We are using Java appendix coding
Provide a Rectangle.java file whose Rectangle class contains: Two instance variables - height and width. Two mutator methods named setHeight and setWidth. .A method named getArea that calculates and returns the rectangle's area. For practice purposes, use a local variable . A method named displayArea that calculates and prints the rectangle's area. This time, do not use a local variable. Provide a RectangleDriver.java file that works in conjunction with the Rectangle class. Specifically, your RectangleDriver class should Declare and instantiate a Rectangle object. Prompt the user for height and width values. Call the setHeight and setWidth methods. Print the rectangle's area by embedding a getArea method call within the print statement. Call the displayArea method. Enter rectangle's height: 4 Enter rectangle's width: 3.2 Area = 12 . 8 Area12.8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
