When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.
1 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.
@timid pine's code (missing deletion permissions):
int main() {
int people;
int hotdogPerPerson;
int hotdog;
int hotdogPackage;
int bunsPackage;
int hotdogLeftOver;
int bunsLeftOver;
cout << "Welcome to the cookout enter how many people will be attending "
"this party: "
<< endl;
cin >> people;
cout << "Enter how many hotdogs per person?: " << endl;
cin >> hotdogPerPerson;
hotdog = people * hotdogPerPerson;
hotdogPackage = hotdog / hotdogPackage;
bunsPackage = hotdog / bunsPackage;
hotdogLeftOver = hotdog % hotdogPackage;
bunsLeftOver = hotdog % hotdogPackage;
cout << "You will need " << hotdogPackage << " hotdog packages and "
<< bunsPackage << "." << endl;
cout << "You will have " << hotdogLeftOver << " hotdogs left over and "
<< bunsLeftOver << "." << endl;
return 0;
}```
whats that
formatting
You never defined the values of bunsPackage HotdagPackage
ah
const double hotdogPackage = 10;
const double bunsPackage = 8;
int main()
{
int people;
int hotdogPerPerson;
int hotdog;
int hotdogPackage;
int bunsPackage;
int hotdogLeftOver;
int bunsLeftOver;
cout<< "Welcome to the cookout enter how many people will be attending this party: "<<endl;
cin >> people;
cout<< "Enter how many hotdogs per person?: "<<endl;
cin >> hotdogPerPerson;
hotdog = people * hotdogPerPerson;
hotdogPackage = hotdog / hotdogPackage;
bunsPackage = hotdog / bunsPackage;
hotdogLeftOver= hotdog % hotdogPackage;
bunsLeftOver = hotdog % hotdogPackage;
cout<<"You will need "<< hotdogPackage << " hotdog packages and "<< bunsPackage << "." <<endl;
cout<<"You will have "<< hotdogLeftOver << " hotdogs left over and " << bunsLeftOver<< "."<<endl;
return 0;
}
sry i didnt copy and paste the whole thing
but thsi still doesnt work
You are declaring them twice with different tyes
types
const double hotdogPackage = 10;
const double bunsPackage = 8;
int main()
{
int people;
int hotdogPerPerson;
int hotdog;
int hotdogPackage;
int bunsPackage;
int hotdogLeftOver;
int bunsLeftOver;
!code
• type three "backticks" (not quotes/apostrophes, on QWERTY layout, left of 1-key)
• on the same line, type the file extension for that language (c or cpp)
• enter your code on a new line and put another three backticks at the end
```cpp
int main() {
return 0;
}
```
int main() {
return 0;
} ```
!solved