Test Case 1 Enter length: \n 5 ENTER Enter width: \n 10 ENTER You entered: 5.0, 10.0, and 50.0 \n Rectangle info \n -- Length: 5.0 \n Width: 10.0 \n Area: 50.0 \n Test Case 2 Enter length: \n 47.8 ENTER Enter width: \n 92.3 ENTER You entered: 47.8, 92.3, and 4411.9 \n Rectangle info \n Length: 47.8 \n Width: 92.3 \n Area: 4411.9 \n Test Case 3 Enter length: \n 87.34 ENTER Enter width: \n 2 ENTER You entered: 87.3, 2.0, and 174.7 \n Rectangle info \n -- -- Length: 87.3 \n Width: 2.0\n Area: 174.7 \n
Test Case 1 Enter length: \n 5 ENTER Enter width: \n 10 ENTER You entered: 5.0, 10.0, and 50.0 \n Rectangle info \n -- Length: 5.0 \n Width: 10.0 \n Area: 50.0 \n Test Case 2 Enter length: \n 47.8 ENTER Enter width: \n 92.3 ENTER You entered: 47.8, 92.3, and 4411.9 \n Rectangle info \n Length: 47.8 \n Width: 92.3 \n Area: 4411.9 \n Test Case 3 Enter length: \n 87.34 ENTER Enter width: \n 2 ENTER You entered: 87.3, 2.0, and 174.7 \n Rectangle info \n -- -- Length: 87.3 \n Width: 2.0\n Area: 174.7 \n
Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter7: String Manipulation
Section: Chapter Questions
Problem 22RQ
Related questions
Question
Make a file named Rectangle.java, in that file create a following methods:
//Ask the user for the length of the rectangle.
public static double getLength(Scanner keyboard)
//Ask the user for the width of the rectangle
public static double getWidth(Scanner keyboard)
//Calculate the area of the rectangle
public static double getArea(double length, double width)
//Display the information about the rectangle
public static void displayData(double length, double width)
Write the code in java and use test case # as an example result.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L