Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a java program that specifies three one dimensional arrays name length, width, and area. Each array should be capable of holding a number elements

Write a java program that specifies three one dimensional arrays name length, width, and area. Each array should be capable of holding a number elements provided by user input. Using a for loop input values for length and width arrays. The entries in the area arrays should be the corresponding values in the length and width arrays (thus, area[i] = length [i]* width [i]) after data has been entered display the following output:

Length Width Area

-------- -------- -------

25 2.6 65.00

18.2 4.9 89.18

Sample Run1

Enter the array size: 5

Enter the Length and Width for Rectangle 1:25 2.6

Enter the Length and Width for Rectangle 2:18 4.9

Enter the Length and Width for Rectangle 3:100 3.27

Enter the Length and Width for Rectangle 4:1.84 7.4

Enter the Length and Width for Rectangle 5:56 9.5

Output1:

Length Width Area

-------- -------- -------

25 2.6 65.00

18.2 4.9 89.18

100 3.27 327.00

1.84 7.4 13.62

56 9.5 532.00

Step by Step Solution

3.43 Rating (153 Votes )

There are 3 Steps involved in it

Step: 1

import javautilScanner public class Chegg5 public stat... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Java Programming, Comprehensive Version

Authors: Y. Daniel Liang

10th Edition

133761312, 978-0133761313

More Books

Students also viewed these Programming questions

Question

How do digital media change how we relate to others?

Answered: 1 week ago