// ------------------------------------------------------------------
// 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.
//-| ----------------------------------------------------------------
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.
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.
//-| ----------------------------------------------------------------