Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program A box of cookies can hold 24 cookies and a container can hold 75 boxes of cookies. Write a program that

Write a Java program

A box of cookies can hold 24 cookies and a container can hold 75 boxes of cookies. Write a program that prompts the user to enter the total number of cookies, then outputs the number of boxes and the number of containers to ship the cookies. If there are not enough cookies to fill a box, the box can be discarded and the number of leftover cookies should be output. If the number of boxes will not fill a container, then the leftover boxes can be discarded and the number of leftover boxes should be output.

For example: You need 1800 cookies (75 boxes each filled with 24 cookies) to fill a container. The user enters 2500 cookies - example output might be:

You entered 2500 cookies.

1 container with 75 boxes of 24 cookies shipped

29 boxes of 24 cookies discarded

4 cookies discarded

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

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions