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 rect

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
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 in java and use test case # as an example result.
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
Length: 87.3 \n
\n
Width: 2.0 \n
Area: 174.7 \n
Transcribed Image Text: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 Length: 87.3 \n \n Width: 2.0 \n Area: 174.7 \n
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY