Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Main topics: Basic Java program Variables in Java Arithmetic Expressions Programmatic output Program Specication: Write a Java program by doing the following: Establish three variables

Main topics: Basic Java program Variables in Java Arithmetic Expressions Programmatic output Program Specication: Write a Java program by doing the following:

Establish three variables to hold the three measurements which are required to dene a rectangular box, (height, width, depth), as well as a fourth variable to hold the units that the measurements are being given in.

Set the values of each of the four variables to match that of a box that you are familiar with.

Calculate the total surface area of the box. Display the total surface area of the box (in your given units squared) to the screen in a reasonable report format.

Calculate the length and width of a single rectangular piece of wrapping paper, that is of sucient size to completely cover (wrap) the entire surface area of the box (hint: there will be folds).

Display the length and width of this piece of wrapping paper (in your given units) to the screen in a reasonable report format. Sample run(s): Given a box with a height of 6.0 in a width of 8.0 in and a depth of 4.0 in The total surface area of the box is : 208.0 in squared. The length of the piece of wrapping paper is 20.0 in. The width of the piece of wrapping paper is 12.0 in.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions