Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Cabe set &gdercise 20 Java Program Define a squared three dimensional cube class, emphasizing individual access to dsta fields It should have three properties) 36

image text in transcribed
Cabe set &gdercise 20 Java Program Define a squared three dimensional cube class, emphasizing individual access to dsta fields It should have three properties) 36 the length of the side length width, & depth are all the same length value so only one field is needed), the color of the cube (as a Suring. Dora Color object), and a boolean fit value schiether the cube should be filled for bollos) It should be able to (ten methods % create a default fully functional unfilled black cube of length of set the values for all fields (individually) 96 get the values for all Gelds (individually) 96 calculate and return the surface area and volume of the cube individually) % resize the length of the cube by a percentage (ex. 25 would increase the length by 25%-10 would decrease the length by 1096) Use proper rules for access and OOP in the Cube definition. Use Math methods where possible in calculations Create the main class. It should: instantiate a cube object Ask the user if they would like to change their cube. If they say yes prompt & input from the user the length, color, and fill put the values into the object's data field (individually) Ask the user if they would hise to resize their subs If they say yes: prompt and input the percentage to resize the length of the cube call the resize method with that percentage to resize the length of the cake Whatever the user answered to the questions (Print the number fields to 2 decimal places) print all labeled data fields separately returned from the classes methods call the methods to calculate and return to print the surface area and volume Add sufficient documentation to both class files - name, exercise, at least 4 lines about purpose at the top of both files, and at least comments throughout each file explaining what is going on (esc astiat methods do or explain a line of code's purpose, etc.) Run the program three separate times with the data below. Save (or Copy and paste) the Console running of your program into a plain output txt text file. Submit your cube java class definition, the source code main program, and the output. xt saved (clear Console. Run thee times, sare Console): Data for three separate runs: Cube 1 say no to change, say yes to resize resize 25 Cube 2: say yes to change; length: 2.0, color: Cyan; fill: true; say yes to resize: resize:-10: Cube 3. say yes to charge, length: 5.7: color. Blue, fili: false, say no to Essins

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students explore these related Databases questions