Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

as you asked for more detail this is all on the paper that's why I hard time not understanding some parties, please if you can't

as you asked for more detail this is all on the paper that's why I hard time not understanding some parties, please if you can't do it you can leave it to someone who might understand it well because this is all information that is in the paper maybe you could have told me what you think is missing image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

I. A Shipping Company App: Suppose you are writing software for a shipping company that uses two types of containers: rectangular boxes and cylindrical tubes. They're interested in knowing how much each container can hold i.e. how much they can put inside the container) as well as how much total surface area there is on the outside of the container i.e. any space where they can place shipping labels, stickers, etc.) a) Begin by writing two classes: Box (to represent a rectangular box) and Tube (to represent a cylindrical tube with closed ends). Question part a) continues on the next page... For each Box, we must record its length, width and height. Include 3 instance variables and an appropriate constructor method. You should also have an accessor method for each instance variable (3 in total), as well as 2 additional accessor methods: one to calculate and retrieve the volume of the box, and another to calculate and retrieve the surface area of the box. For each Tube, we must record its radius and height. Include 2 instance variables and an appropriate constructor method. You should also have an accessor method for each instance variable (2 in total), as well as 2 additional accessor methods: one to calculate and retrieve the volume of the tube, and another to calculate and retrieve the surface area of the tube. Note: Please use the value of Ir that is defined in the Math class. Write javadoc comments for your Box and Tube classes. Include a comment for the class, for each instance variable and each method. Use author. @param & @return tags where appropriate. Run the javadoc utility on your files and view the resulting Box.html and Tube.html files in a browser to make sure that your javadoc comments were inserted/formatted correctly. (Be sure to include Write javadoc comments for your Box and Tube classes. Include a comment for the class, for each instance variable and each method. Use author, @param & @return tags where appropriate. Run the javadoc utility on your files and view the resulting Box.html and Tube.html files in a browser to make sure that your javadoc comments were inserted/formatted correctly. (Be sure to include author and private information when generating the documentation with javadoc.) b) Next, write a driver program that reads in the dimensions for various different containers and displays the volume and surface area of each. After reading in the information for all of the containers, the program should indicate whether the container with the largest volume is a box or a tube, followed by its volume. and then indicate whether the container with the smallest surface area is a box or a tube, followed by its surface area. Begin by presenting the user a list of options, and keep looping until the user indicates that they would like to quit. Below and on the next two pages is sample output to show you how your program should work (note: user input is shown here in bold and italics): What would you like to do? 1 - Get info for a box 2 Get info for a tube 3- Quit Enter your choice: 2 Radius (in cm): 5.75 Height (in cm): 10.2 The volume is: 1,038.689 cubic centimeters The surface area is: 569.021 square centimeters. Question I part b) continues on the next page... What would you like to do? 1 Get info for a box 2 - Get info for a tube 3 - Quit 2- Get info for a tube 3 - Quit Enter your choice: 1 Length (in cm): 6.5 Width (in cm): 8.0 Height (in cm): 5.5 The volume is: 286.000 cubic centimeters. The surface area is: 263.500 square centimeters. What would you like to do? 1 - Get info for a box 2 - Get info for a tube 3 - Quit Enter your choice: 2 Radius (in cm): 10.2 Height (in cm): 20.0 The volume is: 6,283.185 cubic centimeters. The surface area is: 1,884.956 square centimeters. What would you like to do? 1 - Get info for a box 2 - Get info for a tube 3 - Quit Enter your choice: 1 Length (in cm) : 3.75 Width (in cm) : 3.75 Height (in cm) : 25.0 The volume is: 351.562 cubic centimeters. The surface area is: 403.125 square centimeters. What would you like to do? 1- Get info for a box 2 - Get info for a tube 3- Quit Enter your choice: 1 Length (in cm): 15.0 Width (in cm): 15.6 Height (in cm): 20.0 The volume is: 4,500.000 cubic centimeters. The surface area is: 1,650.000 square centimeters. Question part b) continues on the next page... Question I part b) continues on the next page... What would you like to do? 1 - Get info for a box 2 - Get info for a tube 3 - Quit Enter your choice: 3 The container with the largest volume is a tube. Its volume is: 6,283.185 cubic centimeters. The container with the smallest surface area is a box. Its surface area is: 263.500 square centimeters. . NOTE: Each volume and surface area must be displayed with exactly 3 digits to the right of the decimal. If the user enters an invalid input value, print an error message and prompt them again. Repeat this until a valid input value is provided. You may assume that the user will enter a numeric value each time. (You don't need to respond to invalid input that is the wrong type. The program may simply crash & display an exception in that case; that is fine. However, when they enter an integer to indicate their menu choice, you should print an error message and re-prompt them if they enter an integer value other than a 1, 2 or 3. Similarly, the numeric values that they enter for length, width, radius and height should all be positive. If they enter 0 or a negative number, print an error message and re- prompt them. Remember that you should include a Javadoc comment at the top of your driver class for Question part b. This comment should include a one-line description of the class and @author information. After you have tested your application (with several different input values) and NOTE: Each volume and surface area must be displayed with exactly 3 digits to the right of the decimal. . If the user enters an invalid input value, print an error message and prompt them again. Repeat this until a valid input value is provided. You may assume that the user will enter a numeric value each time. (You don't need to respond to invalid input that is the wrong type. The program may simply crash & display an exception in that case; that is fine.) However, when they enter an integer to indicate their menu choice, you should print an error message and re-prompt them if they enter an integer value other than a 1, 2 or 3. Similarly, the numeric values that they enter for length, width, radius and height should all be positive. If they enter O or a negative number, print an error message and re- prompt them. Remember that you should include a Javadoc comment at the top of your driver class for Question I part b. This comment should include a one-line description of the class and @author information. After you have tested your application (with several different input values) and you're sure that it works properly, save sample output for submission. Include at least 3 containers and at least 1 of each container type (box and tube) in the sample output that you submit. Include at least one instance of an invalid numeric input value as well For this question, take a snapshot of the terminal (or Command Prompt) window to include in your zip file. That way, the marker will be able to see the input values as well. Since the output may be rather long, you may need multiple screen captures to get it all. Choose appropriate filenames so the marker will know the order in which these screen captures should be viewed. For your assignment report, you may copy and paste the output from the terminal window into your report (again, this will ensure that the input values are also included.) Question Il begins on the next page... 1. A Shipping Company App: Suppose you are writing software for a shipping company that uses two types of containers: rectangular boxes and cylindrical tubes. They're interested in knowing how much each container can hold fi.e. how much they can put inside the container) as well as how much total surface area there is on the outside of the container (.e. any space where they can place shipping labels, stickers, etc.) a) Begin by writing two classes: Box (to represent a rectangular box) and Tube (to represent a cylindrical tube with closed ends). Question I part a) continues on the next page... V For each Box, we must record its length, width and height. Include 3 instance variables and an appropriate constructor method. You should also have an accessor method for each instance variable (3 in total), as well as 2 additional accessor methods: one to calculate and retrieve the volume of the box, and another to calculate and retrieve the surface area of the box. For each Tube, we must record its radius and height. Include 2 instance variables and an appropriate constructor method. You should also have an accessor method for each Instance variable (2 in total), as well as 2 additional accessor methods: one to calculate and retrieve the volume of the tube, and another to calculate and retrieve the surface area of the tube. Note: Please use the value of it that is defined in the Math class. Write javadoc comments for your Box and Tube classes. Include a comment for the class, for each instance variable and each method. Use Gauthor, param & return tags where appropriate. Run the javadoc utility on your files and view the resulting Box.html and Tube.html files in a browser to make sure that your javadoc comments were inserted/formatted correctly. (Be sure to include and nato information on Nonto the documentation with

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

Students also viewed these Databases questions