Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
Cabe set &get Exercise 30 Java Program Define a squared three dimensional cube class, emphasizing individual access to dsta fields It should have three properties) 3 the length of the side length, width, & depth me all the size length value so only one field is needed), the color of the cube (as a String. not a Color object), and a boolean fit value shether the cube should be filled for hollow) 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 fields (individually) 45 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 10%6) 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 cabe. If they say yes I prompt & input from the user the length, color, and 611 put the values into the object's data field (individually) Ask the user if they would like to resize their gubs If they say yes: prompt and put the percentage to resize the length of the cube call the resize method with that percentage to resize the length of the sake Whatever the user answered to the questions (Print the number fields to 2 decimal places print all labeled data fields separately retarded from the classes methods call the methods to calculate and returns to print the surface area and volume Add sufficient documentation to both class files - Tame, exercise, at least 4 lines about purpose at the top of both files, and at least 5 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 for Copy and paste) the Console running of your program into a plain output txt text file. Submit your cube java class deinstion, the source code main program, and the output. xt saved (clear Console, run three 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 change, length: 5.7. color. Blue, fill: false, say no to size

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

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

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

What is drill down? AppendixLO1

Answered: 1 week ago

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago