Question: 1. Write a Java class that implements the following. We want to make a row of bricks that is goal feet long. The goal is

1. Write a Java class that implements the following.

We want to make a row of bricks that is goal feet long. The goal is provided by the user at run time. The instructions to the user must be clear and concise.

We have a number of small bricks (3 inches each) and large bricks (8 inches each). The numbers are also provided by the user at run time. The input values must be positive

Set a boolean variable to true if it is possible to make the goal by choosing from the given bricks. If it's not possible, set the variable to false.

Display a short message informing the user about the purpose of this class.

Provide appropriate instructions to the user for input values

Display the result as a descriptive sentence.

Note: the bricks cannot be broken up into fractional parts

Example execution:

You are building a section of the wall.

Length of the section of the wall in feet: 2

Input the number of small bricks: 7

Input the number of large bricks: 2

It is not possible to construct the section of the wall with the available bricks.

You are building a section of the wall.

Length of the section of the wall in feet: 3

Input the number of small bricks: 8

Input the number of large bricks: 3

It is possible to construct the section of the wall with the available bricks.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!