Okay, so I have one more set of code I need some help on. How I got this far without smashing my skull into a monitor I still have no idea
I get this error when compiling:
D:\Jen\School\Jen_Tonon_assignment3.cpp In function `int main()':
D:\Jen\School\Jen_Tonon_assignment3.cpp no match for 'operator<<' in 'abovebelow1 << std::endl'
D:\Jen\School\Jen_Tonon_assignment3.cpp no match for 'operator<<' in 'abovebelow2 << std::endl'
D:\Jen\School\Jen_Tonon_assignment3.cpp no match for 'operator<<' in 'abovebelow3 << std::endl'
D:\Jen\School\Jen_Tonon_assignment3.cpp no match for 'operator<<' in 'abovebelow4 << std::endl'
D:\Jen\School\Jen_Tonon_assignment3.cpp no match for 'operator<<' in 'abovebelow5 << std::endl'
Code:
// Personal Survey
// Jennifer Tonon
// 10-12-05
// This progam stores information on students, entered by a teacher, and
// completes a class average.
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
using std::string;
using std::cin;
using std::getline;
int main()
{
string student1;
string student2;
string student3;
string student4;
string student5;
int attendance1, attendance2, attendance3, attendance4, attendance5;
int exam1, exam2, exam3, exam4, exam5;
int final1, final2, final3, final4, final5;
string abovebelow1;
string abovebelow2;
string abovebelow3;
string abovebelow4;
string abovebelow5;
double average;
cout << "Enter first student's name: ";
getline(cin,student1);
cout << "Enter second student's name: ";
getline(cin,student2);
cout << "Enter third student's name: ";
getline(cin,student3);
cout << "Enter fourth student's name: ";
getline(cin,student4);
cout << "Enter fifth student's name: ";
getline(cin,student5);
cout << "Enter first student's attendance: ";
cin >> attendance1;
cout << "Enter second student's attendance: ";
cin >> attendance2;
cout << "Enter third student's attendance: ";
cin >> attendance3;
cout << "Enter fourth student's attendance: ";
cin >> attendance4;
cout << "Enter fifth student's attendance: ";
cin >> attendance5;
cout << "Enter first student's exam score: ";
cin >> exam1;
cout << "Enter second student's exam score: ";
cin >> exam2;
cout << "Enter third student's exam score: ";
cin >> exam3;
cout << "Enter fourth student's exam score: ";
cin >> exam4;
cout << "Enter fifth student's exam score: ";
cin >> exam5;
cout << "Enter first student's final score: ";
cin >> final1;
if (attendance1 >= 5)
final1 = final1 + 5;
cout << "Enter second student's final score: ";
cin >> final2;
if (attendance2 >= 5)
final2 = final2 + 5;
cout << "Enter third student's final score: ";
cin >> final3;
if (attendance3 >= 5)
final3 = final3 + 5;
cout << "Enter fourth student's final score: ";
cin >> final4;
if (attendance4 >= 5)
final4 = final4 + 5;
cout << "Enter fifth student's final score: ";
cin >> final5;
if (attendance5 >= 5)
final5 = final5 + 5;
average = (final1 + final2 + final3 + final4 + final5) / 5;
if (final1 >= average)
abovebelow1 = "Above Average";
else
abovebelow1 = "Below Average";
if (final2 >= average)
abovebelow2 = "Above Average";
else
abovebelow2 = "Below Average";
if (final3 >= average)
abovebelow3 = "Above Average";
else
abovebelow3 = "Below Average";
if (final4 >= average)
abovebelow4 = "Above Average";
else
abovebelow4 = "Below Average";
if (final5 >= average)
abovebelow5 = "Above Average";
else
abovebelow5 = "Below Average";
cout << "Student Name Attendance Exam Score Final Score Above/Below Average ";
cout << student1, attendance1, exam1, final1, abovebelow1 << endl;
cout << student2, attendance2, exam2, final2, abovebelow2 << endl;
cout << student3, attendance3, exam3, final3, abovebelow3 << endl;
cout << student4, attendance4, exam4, final4, abovebelow4 << endl;
cout << student5, attendance5, exam5, final5, abovebelow5 << endl;
system("PAUSE");
return 0;
}
I know it's something stupidly simple that I'm missing, but any help would rock!