I have about 20 minutes to submit this assignment, help greatly appreciated.

can anyone tell me why it won't compile in unix ?

heres my program:

// ------------------------------------------------------------------
// File name: mygpa.cpp
//
// Assign ID: PROG3
//
// Due Date: 2/13/12 at 11pm
//
// Purpose: Write a program to calculate GPA based on the number
// of As, Bs, Cs, Ds and Fs earned by a student. Also
// calculate the number of credit hours taken.
//
// Author: bfields Byron Fields
//
// ------------------------------------------------------------------

#include <iostream>
using namespace std;

int main ()
{
//-| ----------------------------------------------------------------
//-| Declare Variables
//-| ----------------------------------------------------------------

string Name //-| Name of student
int Acount //-| Number of A's student recieved
int Bcount //-| Number of B's student recieved
int Ccount //-| Number of C's student recieved
int Dcount //-| Number of D's student recieved
int Fcount //-| Number of F's student recieved
long ID //-| Student's ID number
int hoursTaken //-| Student's course hours taken
float coursesTaken //-| Number of courses the student has taken
float GPA //-| Student's GPA


//-| ----------------------------------------------------------------
//-| 1. Read the number of A,B,c, and D grades.
//-| ----------------------------------------------------------------

cin >> Acount >> Bcount >> Ccount >> Dcount >> Fcount;

//-| ----------------------------------------------------------------
//-| 2. Read student ID and full name.
//-| ----------------------------------------------------------------
cin >> ID;
cin.getline (Name);
//-| ---------------------------------------------------------------------
//-| 3. Compute coursesTaken = Acount + Bcount + Ccount + Dcount + Fcount;
//-| ---------------------------------------------------------------------
courseTaken = Acount + Bcount + Ccount + Dcount + Fcount;
//-| ---------------------------------------------------------------------
//-| 4. Compute hoursTaken = 3 * coursesTaken;
//-| ---------------------------------------------------------------------
hoursTaken = 3 * coursesTaken;
//-| ---------------------------------------------------------------------
//-| 5. Compute qualityPts = 4*Acount+3*Bcount+2*Ccount+1*Dcount;
//-| ---------------------------------------------------------------------
qualityPts = 4*Acount+3*Bcount+2*Ccount+1*Dcount;
//-| ---------------------------------------------------------------------
//-| 6. Compute GPA = qualityPts / coursesTaken;
//-| ---------------------------------------------------------------------
GPA = qualityPts / coursesTaken;
//-| ---------------------------------------------------------------------
//-| 7. Print the GPA report in this format:
//-|
//-| ===========================================
//-| STUDENT ID: xxxxxxxxx
//-| STUDENT NAME: xxxxxxxxxxxxxxxxxxxxxxx
//-|
//-| LETTER GRADE: A B C D F
//-| COUNT: xx xx xx xx xx
//-|
//-| HOURS TAKEN: xxx
//-| STUDENT GPA: x.xx
//-| ===========================================
//-|
//-| ----------------------------------------------------------------------
cout << "===========================================";
cout << "STUDENT ID:" << "/t" << ID;
cout << " STUDENT NAME: " << setw(25) << Name;
cout << endl;
cout << "LETTER GRADE: " << setw(18) << 'A' << 'B' << 'C' << 'D' << 'F';
cout << "COUNT: " << Acount << Bcount << Ccount << Dcount << Fcount;
cout << endl;
cout << "HOURS TAKEN: " << hoursTaken;
cout << "STUDENT GPA: " << fixed << setprecision(2) << GPA;
cout << "===========================================";
cout << endl;

return 0;
}
You have missing semicolons on a number of rows. You also use the wrong getline function. cin.getline(Name); should be getline(cin, Name);. You have also misspelled some of the variables.
You need to include #include <iomanip> and you need to define qualityPts.
thanks guys. i fixed everything you all pointed out but im still getting this error : mygpa.cpp: In function `int main()':
mygpa.cpp:56: warning: assignment to `int' from `float'
mygpa.cpp:56: warning: argument to `int' from `float'.

this is my edited code:
// ------------------------------------------------------------------
// File name: mygpa.cpp
//
// Assign ID: PROG3
//
// Due Date: 2/13/12 at 11pm
//
// Purpose: Write a program to calculate GPA based on the number
// of As, Bs, Cs, Ds and Fs earned by a student. Also
// calculate the number of credit hours taken.
//
// Author: bfields Byron Fields
//
// ------------------------------------------------------------------

#include <iostream>
#include <iomanip>
using namespace std;

int main ()
{
//-| ----------------------------------------------------------------
//-| Declare Variables
//-| ----------------------------------------------------------------

string Name; //-| Name of student
int Acount; //-| Number of A's student recieved
int Bcount; //-| Number of B's student recieved
int Ccount; //-| Number of C's student recieved
int Dcount; //-| Number of D's student recieved
int Fcount; //-| Number of F's student recieved
long ID; //-| Student's ID number
int hoursTaken; //-| Student's course hours taken
float coursesTaken; //-| Number of courses the student has taken
float GPA; //-| Student's GPA
int qualityPts; //-| Student's points of quality

//-| ----------------------------------------------------------------
//-| 1. Read the number of A,B,c, and D grades.
//-| ----------------------------------------------------------------

cin >> Acount >> Bcount >> Ccount >> Dcount >> Fcount;

//-| ----------------------------------------------------------------
//-| 2. Read student ID and full name.
//-| ----------------------------------------------------------------
cin >> ID;
getline(cin, Name);
//-| ---------------------------------------------------------------------
//-| 3. Compute coursesTaken = Acount + Bcount + Ccount + Dcount + Fcount;
//-| ---------------------------------------------------------------------
//-| 4. Compute hoursTaken = 3 * coursesTaken;
//-| ---------------------------------------------------------------------
hoursTaken = 3 * coursesTaken;
//-| ---------------------------------------------------------------------
//-| 5. Compute qualityPts = 4*Acount+3*Bcount+2*Ccount+1*Dcount;
//-| ---------------------------------------------------------------------
qualityPts = 4*Acount+3*Bcount+2*Ccount+1*Dcount;
//-| ---------------------------------------------------------------------
//-| 6. Compute GPA = qualityPts / coursesTaken;
//-| ---------------------------------------------------------------------
GPA = qualityPts / coursesTaken;
//-| ---------------------------------------------------------------------
//-| 7. Print the GPA report in this format:
//-|
//-| ===========================================
//-| STUDENT ID: xxxxxxxxx
//-| STUDENT NAME: xxxxxxxxxxxxxxxxxxxxxxx
//-|
//-| LETTER GRADE: A B C D F
//-| COUNT: xx xx xx xx xx
//-|
//-| HOURS TAKEN: xxx
//-| STUDENT GPA: x.xx
//-| ===========================================
//-|
//-| ----------------------------------------------------------------------
cout << "===========================================";
cout << "STUDENT ID:" << "/t" << ID;
cout << " STUDENT NAME: " << setw(25) << Name;
cout << endl;
cout << "LETTER GRADE: " << setw(18) << 'A' << 'B' << 'C' << 'D' << 'F';
cout << "COUNT: " << Acount << Bcount << Ccount << Dcount << Fcount;
cout << endl;
cout << "HOURS TAKEN: " << hoursTaken;
cout << "STUDENT GPA: " << fixed << setprecision(2) << GPA;
cout << "===========================================";
cout << endl;

return 0;
}



figured it out, couple of variables my teacher gave us to use weren't compatible. Thanks for the help.
Topic archived. No new replies allowed.