Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

writa a java program meeting the following requirements Write a program in Java to read values for width, length and height of a box then

writa a java program meeting the following requirements

image text in transcribed

Write a program in Java to read values for width, length and height of a box then calculate the volume and total surface area of this close box. - Volume = widthxlengthxheight - Area =(2xwidthxlength)+(2xwidthxheight)+(2x lengthxheight ) You should have a method called get Input () with the header below to read all values for width, length and height. public static double getinput (String) That is, call this method three times separately to read the values for width, length and height. The message to be displayed will be passed as an argument. Hence, if you already have three variables called width, length and height in your main () method, the call to get the width, length and height will be something like this: width = getInput ("Get value for width : "); length = getInput ("Get value for length : "); height = getInput ("Get value for height : "); You should also have a method called findVolume () with the header below. Method will accept values for width, length and height, and then calculate and return value for the volume. public static double findVolume (double, double, double) You should also have a method called findArea () with the header below. Method will accept values for width, length and height, and then calculate and return value for the total surface area of a close box. public static double findVolume(double, double, double) Lastly, a method called printInfo() that will accept five values for width,length, height, volume and area and then print each value with some descriptive text. Here is the header for this method. public static void printinfo (double, double, double, double, double)

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