Hey guys, I'm sure I'm making a silly error somewhere, but every time I run my code, I'm getting back "0" and I can't figure out why. Whenever I do the same calculation on my calculator I'm getting completely different results.
Here is the portion of the code that is supposed to be making a calculation. Thanks in advance for any answers!
void zValue(double sampleMean, double populationMean, double populationSTDV, double sampleSize)
{
const string message1 = "Enter your vaules for the Z score.";
double totalZ = ((sampleMean) - (populationMean)) / ((populationSTDV) / sqrt(sampleSize));
cout << "Let's calculate the Z value." << endl;
cout << message1 << endl;
cout << "What is the sample mean? " << endl;
cin >> sampleMean;
cout << "What is the population mean? " << endl;
cin >> populationMean;
cout << "What is the population standard deviation? " << endl;
cin >> populationSTDV,
cout << "What is the sample size? " << endl;
cin >> sampleSize;
cout << "The Z value is: " << totalZ << ".\n";
//Loop
int Yes = 1;
int No = 2;
int exitLoop;
cout << "Would you like to terminate the program?" << endl;
cout << "Press '1' for yes and any other number for no.";
cin >> exitLoop;
while (exitLoop < 1 || exitLoop > 1)
{
cout << message1;
cin >> exitLoop;
}
}