Computer programming i also post first main module of this post. i want 3 remain
ID: 3668486 • Letter: C
Question
Computer programming
i also post first main module of this post. i want 3 remaining modules in this way.
Question: 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 overExplanation / Answer
#include <iostream>
using namespace std;
int main() {
// your code goes here
int peopleCount=0;
int hotDogsPerPerson =0;
int hotDogPackageCount=0;
int bunsPackageCount=0;
int leftoverHotDogsCount=0;
int leftoverBunsCount=0;
const int HOT_DOGS_PER_PACKAGE =10;
const int BUNS_PER_PACKAGE =8;
cout<<"Welcome to the hot dog party";
cout<<endl;
cout<<"";
cout<<"how many people attend the party?";
cin>>peopleCount;
cout<<"Enter how many hot dogs will each person eat?";
cout<<endl;
cin>>hotDogsPerPerson;
calculateHotDogPackages(peopleCount,hotDogsPerPerson,HOT_DOGS_PER_PACKAGE,hotDogPackageCount);
calculateLeftoverHotDogs(peopleCount,hotDogsPerPerson,HOT_DOGS_PER_PACKAGE,hotDogPackageCount,leftoverHotDogsCount);
calculateBunPackages(peopleCount,hotDogsPerPerson,BUNS_PER_PACKAGE,bunsPackageCount);
calculateLeftoverBuns(peopleCount,hotDogsPerPerson,BUNS_PER_PACKAGE,bunsPackageCount,leftoverBunsCount);
cout<<"For party With"<<peopleCount<<" "<<"people each eating"<<hotDogsPerPerson<<" "<<"hot dogs you will need";
cout<<hotDogPackageCount<<"package of hot dogs and"<<bunsPackageCount<<" "<<"package of buns";
cout<<"you will have"<<leftoverHotDogsCount<<"hot dogs and "<<leftoverBunsCount<<"burns left over";
cout<<"";
cout<<"party on!";
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.