Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help writing a code for this in java. Thank YOu for the help. b) Write and test the program code in Java. This problem

Need help writing a code for this in java. Thank YOu for the help. image text in transcribed
b) Write and test the program code in Java. This problem will produce a program to compare box volumes The program must ask for two boxes The program must calculate the volume difference, and give the following (in order of If there is no difference, display the volumes are the same lf the volume of one is less than twice the other, display that t is-slightly bigger If the volume of one is less than three times the other, display that it is twice If the volume of one is less than four times the other, display that it is "triple If the volume of one is less than five times the other, display that it is quadruple otherwise, display that it is the calculated multiple second box is wrong) format) The program must indicate the larger box (f not same volume) and by how much The program must not display values less than one (eg. The first box is 0.5 times the size of the . The program must calculate and display the appropriate message (including proper dimension Your code also does NOT (YET) need to worry if the user inputs an invalid value for the input . The output of your code must match the samples EXACTLY You can use the Box class that you created in Lab 3 as a starting point (example: invalid length). We will implement this in a future assignment You can (and should) change the tagline Your code must have the following structure: rate dauble length prvate double height public Bo privase Box secondir Assign2 public statc void main(Stringt) pulic Blokdouble, couble, double) public void calcutate Sceso putlic void depla public void Sample Output 1: (Red indicate user entered, black is displayed by the program) Size calculator- we speak volunes Enter first box dimensions Enter length: 1e Enter width: 10 Enter height: 10 Enter second box dimensions Enter length: 20 Enter width: 20 Enter height: 28 First box: 10.0 x 10.0 x 10.0 volume 1000 Second box: 20.e x 20.e x 20.0 volume 8000 The second box is 8 times the size of the first box

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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_2

Step: 3

blur-text-image_3

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

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions

Question

Recognize the four core purposes service environments fulfill.

Answered: 1 week ago