subject

Given class Rectangle (in file Rectangle. java), complete main() to read and set the base and height of rectangle1 and of rectangle2, determine which rectangle's area is smaller, and output that rectangle's info, making use of Rectangle's relevant methods. Ex: If the input is:3.0 4.04.0 5.0where 3.0 is rectangle1's base, 4.0 is rectangle1's height, 4.0 is rectangle2's base, and 5.0 is rectangle2's height, the output is:Rectangle with larger area:Base: 4.00Height: 5.00Area: 12.00public class Rectangle {private double base;private double height;public void setBase(double userBase){base = userBase;}public void setHeight(double userHeight) {height = userHeight;}public double getArea() {double area = base * height;return area;}public void printInfo() {System. out. printf("Base: %.2f\n", base);System. out. printf("Height: %.2f\n", height);System. out. printf("Area: %.2f\n", getArea());}}import java. util. Scanner;public class RectangleArea {public static void main(String[] args) {Scanner scnr = new Scanner(System. in);Rectangle Rectangle1 = new Rectangle();Rectangle Rectangle2 = new Rectangle();// TODO: Read and set base and height for rectangle1 (use setBase() and setHeight())// TODO: Read and set base and height for rectangle2 (use setBase() and setHeight())// TODO: Determine larger rectangle (use getArea())System. out. println("Rectangle with smaller area:");// TODO: Output larger Rectangle's info (use printInfo())}}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:30
Selective incapacitation is a strategy to reduce prison population
Answers: 3
question
Computers and Technology, 23.06.2019 05:30
Sally is editing her science report about living things. she needs to copy a paragraph from her original report. order the steps sally needs to do to copy the text to her new document.
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Hey i just logged on and one of the moderators deleted a bunch of my answers to questions, even though the answers were right and the people it doesn't make sense but if anyone wants to talk about anything just message me lol (this is super random lol)
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
How should you specify box sizes on a web page if you want the boxes to vary according to the font size of the text they contain? a. in pixels b. in inches c. as percentages d. in em units
Answers: 2
You know the right answer?
Given class Rectangle (in file Rectangle. java), complete main() to read and set the base and height...
Questions
question
Mathematics, 15.04.2020 23:10
question
History, 15.04.2020 23:10
Questions on the website: 13722361