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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education