I'm currently busy with a C++ course, in a chapter about handling batches of data.
The Chapter starts of with this set of code...
At the moment I seem to have a clear understanding of what is happening in this program.
When i try to Compile and build this script it throws out a big set of errors.
I'm typing the code in gedit and compiling with g++ via terminal(which i have done countless times)
I've come to the conclusion that the includes are the main suspect.
Is there some sort of "include" package I need to download and compile like the <aleggro.h> file?
I'm using Fedora 17
#include <iostream>
#include <ios>
#include <iomanip>
#include <string>
using std:: cout; using std::setprecision;
using std::cin; using std::string;
using std::endl; using std::streamsize;
int main()
{
cout << " Please enter your first name?" << endl;
string name;
cin >> name;
cout << "Hello " << name << "!" << endl;
cout << "Please enter your midterm and final exam grades: ";
double midterm, final;
cin >> midterm << final;
cout << " Enter all your homework grades,""followed by end-of-file";
int count = 0;
double sum = 0;
double x;
while (cin >> x)
{
++count;
sum += x;
}
double formula = 0.2 * midterm + 0.4 * final + 0.4 * sum / count;
streamsize prec = cout.precision();
cout << "Your final grade is: " << setprecision(3)
<< formula << setprecision(prec) << endl;
return 0;
}
If you guys have any ideas of what the problem can be I'm open for any ideas.
Try compiling it your selfs and see the errors for yourself.