The Starting out with programming logic and design 4th addition does not teach a
ID: 3872501 • Letter: T
Question
The Starting out with programming logic and design 4th addition does not teach a speific language. It is a intro to logic course and all the programming questions require and answer in PSEUDOCODE. FOR EXAMPLE you have the pseudocode solution for the text book question Chapter 3, Problem 10PE see below,
I need help with Brytewait Starting out with programming logic and design 4th addition tony gaddis
Chapter 3 Programming exercises no 11
I need it the help in Pseudocode
Hot Dog Cookout Calculator
Assume that hot dogs come in packages of 10, and hot dog buns come in packages of 8. Design a modular program that calculates the number of packages of hot dogs and the number of packages of hot dog buns needed for a cookout, with the minimum amount of leftovers. The program should ask the user for the number of people attending the cookout, and the number of hot dogs each person will be given. The program should display the following:
The minimum number of packages of hot dogs required
The minimum number of packages of buns required
The number of hot dogs that will be left over
The number of buns that will be left over
Explanation / Answer
get numberOfPeople
get hotDogPerPerson
totalHotDog=numberOfPeople*hotDogPerPerson
totalHotDobBUns=totalHotDog
if(totalHotDog%10 is not =0)
{
minHotDog=totalHotDog/10+1
hotDogLeftOver=totalHotDog%10;
}
else
{
minHotDog=totalHotDog/10
hotDogLeftOver=0
}
if(totalHotDogBuns%8 is not =0)
{
minHotDogBun=totalHotDogBuns/8+1
hotDogBunLeftOver=totalHotDog%8;
}
else
{
minHotDogBun=totalHotDog/8
hotDogBunLeftOver=0
}
print mnHotDog
print minHotDogBun
print hotDogLeftOver
print hotDogBunLeftOver
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.