Box of Rocks Program DESCRIPTION: Create a program that asks a user how many rocks will be used to fill boxes. Assuming it takes 8 rocks to fill a box, on average, respond to the user with the number...



Box of Rocks Program


DESCRIPTION:Create a program that asks a user how many rocks will be used to fill boxes. Assuming it takes 8 rocks to fill a box, on average, respond to the user with the number of boxes that will be filled and the number of rocks left over. Make sure your output is formatted as shown below.



SPECIFICATIONS:

  • You have all the skills necessary to complete this program. If you need help reference the code from last week's programs.




  • Name your programBoxOfRocks.java





  • Create a method calledfillBoxes()which will be called from main to compute and output the number of boxes that will be filled and the number of rocks left over, as shown below.




  • Add a comment with your name, date, and program description at the top!




  • Be sure to close the Scanner class object! scanner.close();





  • Test Cases:

Case 1: 0Case 2: 8Case 3: 55Case 4: 121Case 5: 240SAMPLE OUTPUT:==================Enter the number of rocks:
26
You will completely fill 3 boxes.
You will have 2 rocks left over.
Mar 03, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here