dubstar
format c:
- Joined
- 3 Dec 2002
- Messages
- 1,357
i don't understand what i did wrong. i looked at the error checker but i dont really understand what it is saying...
"
1>gradecpp.cpp(96) : error C2146: syntax error : missing ';' before identifier 'endl'
"
but why would you need a semi colon before endl? ?? plus there is a problem with "
if ( status = "FT" )
{
cout << "What is your GPA?" endl;
cin >> gpa;
}
"
1>gradecpp.cpp(96) : error C2146: syntax error : missing ';' before identifier 'endl'
"
but why would you need a semi colon before endl? ?? plus there is a problem with "
if ( status = "FT" )
{
cout << "What is your GPA?" endl;
cin >> gpa;
}
Code:
[SIZE=2][COLOR=#008000]/*[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]******************************************[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]** Program name: GradeCheck *****[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]*** Date: March 02 2007 ****[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]**** Author: Alan Rosenquist ***[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]***** Description: Calcs GPA **[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]******************************************[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]*/[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]// Library[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]#include[/COLOR][/SIZE][SIZE=2][COLOR=#a31515]<iostream>[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]#include[/COLOR][/SIZE][SIZE=2][COLOR=#a31515]<string>[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]namespace[/COLOR][/SIZE][SIZE=2] std;[/SIZE]
[SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][SIZE=2] main()[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#008000]// Header[/COLOR][/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]" \t ****** * * ******* ***** ******* "[/COLOR][/SIZE][SIZE=2] << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]" \t* * * * * * * "[/COLOR][/SIZE][SIZE=2] << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]" \t* * * * * ***** * "[/COLOR][/SIZE][SIZE=2] << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]" \t* * * * * * * * "[/COLOR][/SIZE][SIZE=2] << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]" \t ****** ****** ******* ****** * "[/COLOR][/SIZE][SIZE=2] << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]" \t * Program name:"[/COLOR][/SIZE][SIZE=2] << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]" \t * Date: March 02 2007"[/COLOR][/SIZE][SIZE=2] << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]" \t * Author: Alan Rosenquist"[/COLOR][/SIZE][SIZE=2] << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]" \t * Description:"[/COLOR][/SIZE][SIZE=2] << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]""[/COLOR][/SIZE][SIZE=2]<< endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]""[/COLOR][/SIZE][SIZE=2] << endl;[/SIZE]
[SIZE=2][COLOR=#008000]// Declaration of[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][SIZE=2] id; [/SIZE][SIZE=2][COLOR=#008000]// student id number[/COLOR][/SIZE]
[SIZE=2]string fname; [/SIZE][SIZE=2][COLOR=#008000]// students first name[/COLOR][/SIZE]
[SIZE=2]string lname; [/SIZE][SIZE=2][COLOR=#008000]// students last name[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][SIZE=2] cbis11; [/SIZE][SIZE=2][COLOR=#008000]// cbis11 score[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][SIZE=2] cbis12; [/SIZE][SIZE=2][COLOR=#008000]// cbis12 score[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][SIZE=2] cbis36; [/SIZE][SIZE=2][COLOR=#008000]// cbis 36 score[/COLOR][/SIZE]
[SIZE=2]string status; [/SIZE][SIZE=2][COLOR=#008000]// full time or part time status in school[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][SIZE=2] total; [/SIZE][SIZE=2][COLOR=#008000]// total sum of grades[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][SIZE=2] average; [/SIZE][SIZE=2][COLOR=#008000]// total sum of grades divided by total number of grades[/COLOR][/SIZE]
[SIZE=2]string grade; [/SIZE][SIZE=2][COLOR=#008000]// grade letter[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][SIZE=2] gpa; [/SIZE][SIZE=2][COLOR=#008000]// grade point average[/COLOR][/SIZE]
[SIZE=2]string message; [/SIZE][SIZE=2][COLOR=#008000]// grade message, triggered by A or F.[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]// Input[/COLOR][/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"What is your ID number? "[/COLOR][/SIZE][SIZE=2] ; [/SIZE][SIZE=2][COLOR=#008000]// ask for input id number[/COLOR][/SIZE]
[SIZE=2]cin >> id; [/SIZE][SIZE=2][COLOR=#008000]// get id number[/COLOR][/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"What is your First name? "[/COLOR][/SIZE][SIZE=2] ; [/SIZE][SIZE=2][COLOR=#008000]// ask for first name[/COLOR][/SIZE]
[SIZE=2]cin >> fname; [/SIZE][SIZE=2][COLOR=#008000]// get first name[/COLOR][/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"What is your Last name? "[/COLOR][/SIZE][SIZE=2] ; [/SIZE][SIZE=2][COLOR=#008000]// ask for last name[/COLOR][/SIZE]
[SIZE=2]cin >> lname; [/SIZE][SIZE=2][COLOR=#008000]// get last name[/COLOR][/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"What is your CBIS 11 Score? "[/COLOR][/SIZE][SIZE=2] ; [/SIZE][SIZE=2][COLOR=#008000]// ask for cbis11 score[/COLOR][/SIZE]
[SIZE=2]cin >> cbis11; [/SIZE][SIZE=2][COLOR=#008000]// get score[/COLOR][/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"What is your CBIS 12 Score? "[/COLOR][/SIZE][SIZE=2] ; [/SIZE][SIZE=2][COLOR=#008000]// ask for cbis12 score[/COLOR][/SIZE]
[SIZE=2]cin >> cbis12; [/SIZE][SIZE=2][COLOR=#008000]// get score[/COLOR][/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"What is your CBIS 36 Score? "[/COLOR][/SIZE][SIZE=2] ; [/SIZE][SIZE=2][COLOR=#008000]// ask for cbis36 score[/COLOR][/SIZE]
[SIZE=2]cin >> cbis36; [/SIZE][SIZE=2][COLOR=#008000]// get score[/COLOR][/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"Press FT for Full Time, or PT for Part Time "[/COLOR][/SIZE][SIZE=2] ; [/SIZE][SIZE=2][COLOR=#008000]// ask Fulltime or Parttime[/COLOR][/SIZE]
[SIZE=2]cin >> status; [/SIZE][SIZE=2][COLOR=#008000]// get FT or PT[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ( status = [/SIZE][SIZE=2][COLOR=#a31515]"FT"[/COLOR][/SIZE][SIZE=2] )[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"What is your GPA?"[/COLOR][/SIZE][SIZE=2] endl;[/SIZE]
[SIZE=2]cin >> gpa;[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#008000]// Process[/COLOR][/SIZE]
[SIZE=2]total = ( cbis11 + cbis12 + cbis36 ) ; [/SIZE][SIZE=2][COLOR=#008000]// total class scores is all the scores added up[/COLOR][/SIZE]
[SIZE=2]average = ( total / 3 ) ; [/SIZE][SIZE=2][COLOR=#008000]// average score is all the scores added, then divided by the number of classes.[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ( average < 60 )[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]grade = [/SIZE][SIZE=2][COLOR=#a31515]"F"[/COLOR][/SIZE][SIZE=2] ; [/SIZE][SIZE=2][COLOR=#008000]// if grade is less than 60, assign grade F[/COLOR][/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ( average < 70 )[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]grade = [/SIZE][SIZE=2][COLOR=#a31515]"D"[/COLOR][/SIZE][SIZE=2] ; [/SIZE][SIZE=2][COLOR=#008000]// if grade is less than 70, assign grade D[/COLOR][/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE]
[SIZE=2]{ [/SIZE]
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ( average < 80 )[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]grade = [/SIZE][SIZE=2][COLOR=#a31515]"C"[/COLOR][/SIZE][SIZE=2] ; [/SIZE][SIZE=2][COLOR=#008000]// if grade is less than 80, assign grade C[/COLOR][/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ( average < 90 )[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]grade = [/SIZE][SIZE=2][COLOR=#a31515]"B"[/COLOR][/SIZE][SIZE=2] ; [/SIZE][SIZE=2][COLOR=#008000]// if grade is less than 90, assign grade B[/COLOR][/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ( average = 90, average > 90 )[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]grade = [/SIZE][SIZE=2][COLOR=#a31515]"A"[/COLOR][/SIZE][SIZE=2] ; [/SIZE][SIZE=2][COLOR=#008000]// if grade is equal to 90, or above 90, assign grade A[/COLOR][/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ( gpa > 3.5 ) [/SIZE][SIZE=2][COLOR=#008000]// if GPA is greater than 3.5, congrats display message.[/COLOR][/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]message = [/SIZE][SIZE=2][COLOR=#a31515]" \[/COLOR][/SIZE]
[SIZE=2][COLOR=#a31515]*************************************************** endl; \[/COLOR][/SIZE]
[SIZE=2][COLOR=#a31515]* Comments: Congratulations on your achievements! * endl; \[/COLOR][/SIZE]
[SIZE=2][COLOR=#a31515]* You Made The Dean's List!!!! * endl; \[/COLOR][/SIZE]
[SIZE=2][COLOR=#a31515]***************************************************"[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ( gpa < 2 ) [/SIZE][SIZE=2][COLOR=#008000]// if GPA is lower than 2, display warning message.[/COLOR][/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]message = [/SIZE][SIZE=2][COLOR=#a31515]" \[/COLOR][/SIZE]
[SIZE=2][COLOR=#a31515]*************************************************** endl; \[/COLOR][/SIZE]
[SIZE=2][COLOR=#a31515]* Comments: You need to be working MUCH harder!! * endl; \[/COLOR][/SIZE]
[SIZE=2][COLOR=#a31515]* You are on Academic Probation * endl; \[/COLOR][/SIZE]
[SIZE=2][COLOR=#a31515]***************************************************"[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#008000]// Clear The Console Screen[/COLOR][/SIZE]
[SIZE=2]system([/SIZE][SIZE=2][COLOR=#a31515]"cls"[/COLOR][/SIZE][SIZE=2]); [/SIZE][SIZE=2][COLOR=#008000]// clear the screen before displaying results.[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]// Output[/COLOR][/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]" ----------------------------------------------------------------------- "[/COLOR][/SIZE][SIZE=2] endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"Student Grading System (SGS)"[/COLOR][/SIZE][SIZE=2] endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"Long Beach City College"[/COLOR][/SIZE][SIZE=2] endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"Author: Alan Rosenquist"[/COLOR][/SIZE][SIZE=2] endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"March 2nd, 2007"[/COLOR][/SIZE][SIZE=2] endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"======================================================================="[/COLOR][/SIZE][SIZE=2] endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"ID #: "[/COLOR][/SIZE][SIZE=2] << id << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"First Name: "[/COLOR][/SIZE][SIZE=2] << fname << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"Last Name: "[/COLOR][/SIZE][SIZE=2] << lname << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"\n"[/COLOR][/SIZE][SIZE=2] endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"Total Score: "[/COLOR][/SIZE][SIZE=2] << total << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"Average Score: "[/COLOR][/SIZE][SIZE=2] << average << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"Grade: "[/COLOR][/SIZE][SIZE=2] << grade << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"Status: "[/COLOR][/SIZE][SIZE=2] << status << endl;[/SIZE]
[SIZE=2]cout << [/SIZE][SIZE=2][COLOR=#a31515]"Semester GPA: "[/COLOR][/SIZE][SIZE=2] << average << endl;[/SIZE]
[SIZE=2]cout << message << endl;[/SIZE]
[SIZE=2]cin >> endl;[/SIZE]
[SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][SIZE=2] 0;[/SIZE]
[SIZE=2]}[/SIZE]