Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective: The goal of this assignment is to practice arrays of objects Background: The software you designed as a part of Lab 1 impressed the

image text in transcribedimage text in transcribed

Objective: The goal of this assignment is to practice arrays of objects Background: The software you designed as a part of Lab 1 impressed the Director of the local FedEx ship center. FedEx comes back to you for your assistance. The ship center recently received a big order from a basketball manufacturer. Each basketball must be inside a box during transportation. You are hired by the FedEx ship center to build a software that can optimize the use of boxes Assignment: The client will provide data in the fom of a text file. Some lines at the beginning will contain three numbers separated by spaces representing the width, height, and length of the available size of boxes in the inventory. Note that each of these lines represents a box-type. The ship center has unlimited supplies of any available box-types The rest of the lines will contain only one number in each line to represent the radius of a basketball. Your task is to find the smallest box-type that can fit a basketball inside it. The word "smalles" refers to a comparison in terms of the volume of the boxes Your program must provide the following information as terminal output. . For each of the basketballs, provide the best box-type (that is, the size of the smallest box that can fit the basketball). If there is no box-type that will be able to fit a basketball, print "Box not available for this basketball . For each of the basketballs, provide the volume of the selected box-type, the volume of the basketball, and the volume of the empty space inside the box after placing the basketball. If your answer was "Box not available for this basketball" then just provide the volume of the basketball How many basketballs were you able to fit in the available box-types? Provide a list of radii of the basketballs that do not fit in any box. Provide a list of box-types (sizes) that were not used at all . . . Requirements You must write and use two classes: BoxType and Basketball. They should be written in two java files: BoxType.java and Basketball.java. The BoxType class will contain the status of the box type (width, height, and length) and other necessary methods. Similarly, the Basketball class will contain the radius of a basketball and other necessary methods You must create all the BoxType and Basketball objects in a separate class named MainProg.java that has the main method. Your program must create and use an array of BoxType objects and an array of Basketball objects containing the box-types and basketball information provided in the input file . . . You are not allowed to write code to compute the volume of a box-type in the MainProg.java file. You must write the code to compute the volume of a box-type in the BoxType.java file. The BoxType class must contain the following methods

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