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

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter4: Making Decisions
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question

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:

  1. Number of people attending the cookout
  2. 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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

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. 

0
1
2
3
4
5
7
Source Code Viewer
8
9
10
11
12
13
14
15
16
17
18
19
Auto Pseudocode
Function Main
20 End
+
▶ ► ▷| ||
Breonnaleigh Harrison, 9/13/22
This program calculates the number of packages of hot dogs and buns needed for a cookout with minimum leftovers
Declare Real bunsPack, hotdogPack, numofPeople, dogsperPpl, total, dogsLeft, bunsLeft
Type here to search
Assign buns Pack = 8
Assign hotdogPack = 10
Output "Enter number of people attending the cookout: "
Input numof People
Output "Enter number of hotdogs per person: "
Input dogsperPpl
Assign total = numofPeople * dogsperPpl
Assign hotdogPack = total / hotdogPack
Assign buns Pack = total / buns Pack
Assign dogsLeft = total % 10
Assign buns Left = total % 8
Output "Minimum packages of hotdogs needed: & ToFixed (hotdog Pack, 1)
Output "Minimum packages of hotdog buns needed: " & ToFixed (buns Pack, 1)
Output "Number of hotdogs left over: & dogsLeft
11
Output "Number of hotdogs buns left over: & bunsLeft
75°F Sunny
I
10:38 AM
9/21/2022
X
10
Transcribed Image Text:0 1 2 3 4 5 7 Source Code Viewer 8 9 10 11 12 13 14 15 16 17 18 19 Auto Pseudocode Function Main 20 End + ▶ ► ▷| || Breonnaleigh Harrison, 9/13/22 This program calculates the number of packages of hot dogs and buns needed for a cookout with minimum leftovers Declare Real bunsPack, hotdogPack, numofPeople, dogsperPpl, total, dogsLeft, bunsLeft Type here to search Assign buns Pack = 8 Assign hotdogPack = 10 Output "Enter number of people attending the cookout: " Input numof People Output "Enter number of hotdogs per person: " Input dogsperPpl Assign total = numofPeople * dogsperPpl Assign hotdogPack = total / hotdogPack Assign buns Pack = total / buns Pack Assign dogsLeft = total % 10 Assign buns Left = total % 8 Output "Minimum packages of hotdogs needed: & ToFixed (hotdog Pack, 1) Output "Minimum packages of hotdog buns needed: " & ToFixed (buns Pack, 1) Output "Number of hotdogs left over: & dogsLeft 11 Output "Number of hotdogs buns left over: & bunsLeft 75°F Sunny I 10:38 AM 9/21/2022 X 10
Console
01
Q Q ▶ HII ■
Enter number of people attending the cookout:
Enter number of hotdogs per person:
Minimum packages of hotdogs needed: 6.6
Minimum packages of hotdog buns needed: 8.3
Number of hotdogs left over: 6
Number of hotdogs buns left over: 2
Type here to search
X=
i
L
77°F Sunny
(4¹))
I
Enter
22
3
10:39 AM
9/21/2022
X
10
Transcribed Image Text:Console 01 Q Q ▶ HII ■ Enter number of people attending the cookout: Enter number of hotdogs per person: Minimum packages of hotdogs needed: 6.6 Minimum packages of hotdog buns needed: 8.3 Number of hotdogs left over: 6 Number of hotdogs buns left over: 2 Type here to search X= i L 77°F Sunny (4¹)) I Enter 22 3 10:39 AM 9/21/2022 X 10
Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT