Hot dogs come 10 to a package and hot dog buns come 8 to a package. Write a Flowgorithm program that calculates the number of packages of hot dogs and buns needed for a cookout with minimum leftovers. The program should ask for the following information: Number of people attending the cookout Number of hot dogs allocated for each person The program should calculate and display the following information: Minimum packages of hot dogs needed Minimum packages of hot dog buns needed Number of hot dogs left over Number of hot dog buns left over
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Hot dogs come 10 to a package and hot dog buns come 8 to a package.
Write a Flowgorithm
and buns needed for a cookout with minimum leftovers.
The program should ask for the following information:
- Number of people attending the cookout
- Number of hot dogs allocated for each person
The program should calculate and display the following information:
- Minimum packages of hot dogs needed
- Minimum packages of hot dog buns needed
- Number of hot dogs left over
- Number of hot dog buns left over
Partial packages of hot dogs and buns CANNOT be purchased.
Remember the following:
- declare all variables and constants
- initialize all constants
- comment box for your name, date and purpose of program
- use other comments where appropriate
- DO NOT “hard code numbers” in calculations, use constants
- use clear prompts for your data input requests
- clearly label each output number or name
- modulo operator might be useful
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
Is there a way to show this using the app Flowgorithm? I ask because when I put in the code, it calculates but not the way it should. It shouldn't show decimals for the answer considering that the instructions says that partial packages can't be purchased. The answer should be rounded up. And since it doesn't round up, the calculations are off and answers are incorrect. I will attach the code from Flowgorithm and the results.