#why isnt this working

1 messages · Page 1 of 1 (latest)

vagrant rivetBOT
#

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.

feral badgerBOT
#

@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;
}```
timid pine
#

whats that

noble ember
#

formatting

timid pine
#

er sry im new

#

this is for my clas

noble ember
#

You never defined the values of bunsPackage HotdagPackage

timid pine
#

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

noble ember
#

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;
timid pine
#

ohhh

#

thanks lm try

noble ember
#

!code

feral badgerBOT
#
How to Format Code on Discord

• 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

Example Input

```cpp
int main() {
    return 0;
}
```

Example Output
int main() {
    return 0;
} ```
timid pine
#

!solved

vagrant rivetBOT
#

Thank you and let us know if you have any more questions!

#

[SOLVED] why isnt this working