09 code yhe following.Program Problem:
A box of cookies can hold 24 cookies and a container can hold 75 boxes of cookies.
Write a java program that prompts the user to enter the total number of cookies. The
program then outputs the number of boxes and the number of containers to ship
the cookies. Note that each box must contain the specified number of cookies and
each container must contain the specified number of boxes. If the last box of
cookies contains less than the number of specified cookies, you can discard it, and
output the number of leftover cookies. Similarly, if the last container contains less
than the number of specified boxes, you can discard it, and output the number of
leftover boxes...?
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images
- Help me with this zybook problem using JavaScriptarrow_forwardHow do I use PYTHON to create a high/low number guessing game? Assignment reads: If the user’s guess is higherthan the randomly chosen number, the program should say “Your guess was too high” and prompt theuser to guess another number. If the user’s guess was lower than the randomly chosen number, theprogram should say “Your guess was too low” and prompt the user to guess another number. Finally, ifthe user guesses correctly, the program should say the user’s guess was correct and tell the user howmany guesses it took them to get the numberarrow_forwardJAVA CODE PLEASE Using conditional and looping structures, make a simple calculator that does the following: First, the program should get a single string ? from the user, so that it knows what type of operation it is supposed to perform. If ? is "negate", obtain one number from the user, then negate the number. Output the negated number. If ? is "add", obtain two numbers from the user, then add the two numbers. Output the sum. similar goes to "subtract" & "multiply" division is excluded If ? is "max", obtain two numbers from the user, then get the larger value between the two numbers. If the numbers are equal, output any of them. Input: The first line of input contains a single integer ? (1≤?≤10), which is the number of operations you have to perform. This is followed by a single line containing ? operations separated by a single space. The start of each operation contains a string (which can be negate, add, subtract, multiply or max). If the string is negate, this will be…arrow_forward
- 9: perfect.cpp) A number is called perfect if the sum of its divisors is equal to the original number. A number is called deficient if the sum of its divisors is less than the original number. A number is called abundant if the sum of its divisors is more than the original number. Write a program that answers the following questions: What numbers below 5000 are perfect? What odd numbers below 5000 are abundant? What are the relative proportions of deficient, abundant, and perfect numbers? 5000 should be in a global constant.arrow_forwardHawaiian Words CSC220 Must use Java Programming. Write a program that gives the pronunciation of a Hawaiian word. For instance, humuhumunukunukuapua’a phonetic guide would be Hoo-moo-hoo-moo-noo-koo-noo-koo-ah-poo-ah'ah The program should start by prompting for and reading in a Hawaiian word (or phrase) from the user. Check if the word is a valid by checking that it only has valid Hawaiian characters. If the word is not valid, warn the user about the offending character and prompt for a Hawaiian word again. Spaces are breaks for words and should be kept intact. The apostrophe is a hard stop andshould be kept in the word. Print the pronunciation of the word (or phrase). Print a dash after every sound as you see in the examples, so you get the syllables separated. Ask the user if they want to do another word. Valid responses are y, Y, n or N. If they want to play more, they can enter another word. If not, then the program ends. You won’t be able to just use the .replace() method.…arrow_forward3. The bin packing problem is to pack the objects of various weights into containers. Assume that each container can hold a maximum of 10 pounds. The program uses an algorithm that places an object with the largest weight into the first bin in which it would fit. Your program should prompt the user to enter the total number of objects and the weight of each object. The program displays the total number of containers needed to pack the objects and the contents of each container. Here is a sample run of the program: Enter the number of objects about itinerary with the following members: 1. A data field named flgihts of the List type. The list contains the flights for the itinerary in increasing order of departure Time. A constructor that creat: 6 Enter the weights of the objects: 7 5 2 3 5 8 Container 1 contains objects with weight 8 2 Container 2 contains objects with weight 7 3 Container 3 contains objects with weight 55arrow_forward
- Please answer question. This is pertaining to Java programming language 1-21arrow_forwardHomework write a program that will add the terms of an infinite geometric series. The program should read the first term (a) and the common ratio (r) for the series. It should the compute the sum in two ways: by formula (s=a/1-r), and by adding the individual terms until the answer agrees with the formula to 7 significant digits. The print the formula answer, the answer found by adding terms, and the number of terms that were added. Print the sums to at least ten places. Verify input with a while loop. Two real values are equal to n significant digits if the following condition is true: |a-b|<|a*10^-n| Wrong test - this won't work if r is very near one. Try a=2, r=.99999 With smaller values of r, it is asking for too much precision. With a=2,r=.99, it is getting 10 significant digits. HELP ME FIX CODE. PLEASE USE MY CODE FIX #include <iostream>#include <cmath>using namespace std; int main(){ //declare variables int terms; double a, r, number, sumbyformula, sum2;…arrow_forwardQ5/ By using Matlab write a program that will determine the price of traveler ticket based on customer sage The program must able to input the customer's age then set the conditions so the price is determined as follows: age 0-5 6-20 price-15000 1.D (Iraqi dinar) price 25000 ID(Iraqi dinar) price 40000 1.D (Iraqi dinar) age >21arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education