## ScalesTech -2

// Energy drink assignment from page 77 #18
#include <iostream>
using namespace std;
int main ()
[{
int numberSurveyed = 12,467;
int energyDrinkers;
int citrusFlavor;

energyDrinkers =static_cast<int>(numberSurveyed)* 0.14;
citrusFlavor =static_cast<int>(energyDrinkers)* 0.64;

// Approimate calculations from survey print out
// 14% of 12,467
cout << "Approximate number of customers who purchase one or more energy drinks per week" << energyDrinkers << endl;
//64% of the outcome of energy drinkers
cout << "Approximate number of customers who perfered citrus" << citrusFlavor << endl;

return 0;
}]

## ScalesTech -2

can someone please assist me with this issue?

// Energy drink assignment from page 77 #18
#include <iostream>
using namespace std;
int main ()
[{
int numberSurveyed = 12,467;
int energyDrinkers;
int citrusFlavor;

energyDrinkers =static_cast<int>(numberSurveyed)* 0.14;
citrusFlavor =static_cast<int>(energyDrinkers)* 0.64;

// Approimate calculations from survey print out
// 14% of 12,467
cout << "Approximate number of customers who purchase one or more energy drinks per week" << energyDrinkers << endl;
//64% of the outcome of energy drinkers
cout << "Approximate number of customers who perfered citrus" << citrusFlavor << endl;

return 0;
}]

## Fbody 682

Can't help much for 2 reasons:
1. Is there supposed to be a question in there somewhere?

2. [code] ...code tags... [/code] are your friend.

``````#include <iostream>
int main() {
std::cout << "This looks nice, and is easily readable." << std::endl;
return 0;
}``````

#include <iostream>
int main() {
std::cout << "This looks like dung, and isn't readable." << std::endl;
return 0;
}

I have a question for you. Why does your main() start with '[{' and end with '}]'? That's clearly not right...

[

## ScalesTech -2

I guess I need to learn how to thread properly as well

## Fbody 682

You're new, so no worries. As long as you're aware. Now, what exactly is the issue? I'm afraid we can't help much because you haven't exactly given us any information to go on.

What is the program supposed to do? Where are you having an issue? This is obviously some sort of compilation error, so the complete error message and your IDE/compiler information will be helpful. Is there any other information that you think may be beneficial to us? What have you tried on your own to correct the issue?

## ScalesTech -2

ok, I think I may have found the issue...

// Energy drink assignment from page 77 #18
#include <iostream>
using namespace std;
int main ()
{
int numberSurveyed = 12467;
int energyDrinkers;
int citrusFlavor;

energyDrinkers =static_cast<int>(numberSurveyed)* 0.14;
citrusFlavor =static_cast<int>(energyDrinkers)* 0.64;

// Approimate calculations from survey print out

// 14% of 12,467
cout << "Approximate number of customers who purchase one or more energy drinks per week" << energyDrinkers << endl;

//64% of the outcome of energy drinkers
cout << "Approximate number of customers who perfered citrus" << citrusFlavor << endl;
return 0;
}

## ScalesTech -2

The program is suppose to show the approximate number of customers in the survey who purchase energy drinks. Then it should show the number of customers who perfer citrus

## ScalesTech -2

My apologies for the bad threading... I will learn shortly and post better next time.Thanks for any help and time put forward to answering my questions.

One more thing, when it prints it quickly disappears. Any suggestions?

## Fbody 682

Right before your return 0, add the line cin.get(). That will make the program wait for you to press a key. Then, when you press a key, it will close.

## ScalesTech -2

Thank you Fbody!!