Can someone please explain the concept of "float?"
I read this:
http://www.cplusplus.com/reference/cfloat/
would like to know more...
my code works... i am just curious about what float is? the homework states,
"although the individual values are integers, the results are floating- point values." can someone explain the "inbetween" process a little more, please?
i put the command in bold that is in question...
code is below:
//Write an interactive program that computes and outputs the mean and standard deviation of a set of four integer values that are input by the user
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main ()
{
// Declare your integers.
int numone;
int numtwo;
int numthree;
int numfour;
int n=4;
cout << "Please type four integer values, pressing the Enter key when complete:" << endl;
cin >> numone >> numtwo >> numthree >> numfour;
// results in floating-point values
float mean, standev;
//calc. the mean
mean= (numone + numtwo + numthree + numfour) / (n * 1);
//calc. the standard deviation
standev= pow ((numone-mean), 2) + pow ((numtwo-mean), 2);
standev= standev/(n-1);
standev= sqrt(standev);
// console display of mean and standard dev.
cout << "The mean of the four values is:" << mean << endl;
cout << "The standard deviation of the set is:" << standev << endl;
cin.get();
cin.get();
return 0 ;
}