Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,856 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,348 people online right now. Registration is fast and FREE... Join Now!




C++ GradeBook -- Need Help

2 Pages V  1 2 >  
Reply to this topicStart new topic

C++ GradeBook -- Need Help, Help

pngrafxx126
22 Feb, 2007 - 09:31 PM
Post #1

New D.I.C Head
*

Joined: 7 Nov, 2006
Posts: 33


My Contributions
Hello, I would like help in making this gradebook that teachers can use. I have most of it done. It's just not compiling right. I think I'm missing something but I can't figure it out. Basically, the instructions are as follows

The program has to process as many students as the file holds up to a predetermined maximum number (mine being 10), The system has to compute the average for each student, error check the grades for validity
(A grade is considered invalid if it is negative), and write out the data to a text file.

I have to interact with the system through a simple command-based user interface.

The command include: S O and E.

- S: Sets up a new semester - system will take grades of assignments, quizzes, and the final. and calculate the average for each student. then print out the letter grade.

- O: Output grade data to a text file - The student number, and grade book data must be printed out to a file GRADEOUT. Format the data nicely, with appropriate labels.

- E: Exit system - Save all the student record data to the GRADEDAT file, and terminate the program.


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

//void computeStudAver(const int grade[][numQuiz], double stAve[]);
//void computeQuizAver(const int grade[][numQuiz], double quizAve[]);
//void printall(const int grade[][numQuiz],

int menu();

int main()
{
    const int numStudents = 5, numQuiz = 10, numAssign = 10, numFinal = 1;
    const int totalGrades = 21;
    int grade[numStudents][numQuiz];
    double stAve[numStudents];
    double quizAve[numQuiz];
    
    int choice = menu();
    while(choice != 3)
    {
        choice = menu();
        switch(choice)
        {
        case 1:
            cout << "Welcome. You have started a new semester! To start the grading process, press any key to continue."
            inputgrades();
            break;

        case 2:
            printall(grade[][numQuiz], stAve[], quizAve[]);
            break;

        case 3:
            cout << "Quitting..." << endl;
            break;
        }
    
    computeStudAver(grade, stAve);
    computeQuizAver(grade, quizAve);
    printall(grade, stAve, quizAve);
    return 0;
}

int menu()
{
    int choice;
    cout << "S. Start a new semester."<<endl;
    cout << "O. Output Data."<<endl;
    cout << "E. Exit"<<endl;
    cin >> choice;
    cout << endl << endl;;
    return choice;
}

int calcgrade(double average, char& grade)
{
    if (average <= 59)
    grade = 'F';
    if (average <= 69 && average >= 60)
    grade = 'D';
    if (average <= 79 && average >= 70)
    grade = 'C';
    if (average <= 89 && average >= 80)
    grade = 'B';
    if (average >= 90 && average <= 100)
    grade = 'A';
    return 0;
}

void inputgrades(const int grade[][totalGrades], int g[]) {
     cout << "How many grades will you add per student?";
     cin >> quizN;
     for (g = 1; g <= quizN; g++;)
         cout << "Enter the students' grade: " << endl;
         cin >> g;
}

void computeStudAver(const int grade[][numQuiz], double stAve[]) {
     for (int stN = 1; stN <= numStudents; stNum++) {
         double sum = 0;
         for (int quizNum = 1; quizNum <= numQuiz; quizNum++)
             sum = sum + grade[stNum-1][quizNum-1];
         stAve[stNum-1] = sum/numQuiz;
         }
}

void computeQuizAver(const int grade[][quizNum], double quizAve[]) {
     for (int quizNum = 1; quizNum <= numQuiz; quizNum++) {
         double sum = 0;
         for (int stN = 1; stN <= numStudents; stN++)
             sum = sum + grade[stN-1][quizNum-1]
         quizAve[quizNum-1] = sum/numStudents;
     }
}

void printall(const int grade[][numQuiz], const double stAve[], const double quizAve[]) {
     cout.setf(ios.fixed);
     cout.setf(ios.showpoint);
     cout.precision(1);
    
     outFile.open("C:\\Documents and Settings\\grafxx\\Desktop\\output1.txt");
     outFile << setw(10) << "Student" << setw(5) << "Average" << setw(15) << "Quizzes\n";
     for (int stN = 1; stN <= numStudents; stN++) {
              cout << setw(10) << stN << setw(5) << stAve[stN-1] << " ";
         for (int quizNum = 1; quizNum <= numQuiz; quizNum++)
             cout << setw(5) << grade[stN-1][quizNum-1];
         cout << endl;
         }
     cout << "Quiz averages = ";
     for (int quizNum = 1; quizNum <= numQuiz; quizNum ++)
         cout << setw(5) << quizAve[quizNum-1];
     cout << endl;
}


This post has been edited by pngrafxx126: 22 Feb, 2007 - 10:33 PM
User is offlineProfile CardPM
+Quote Post

horace
RE: C++ GradeBook -- Need Help
22 Feb, 2007 - 11:22 PM
Post #2

D.I.C Addict
Group Icon

Joined: 25 Oct, 2006
Posts: 573



Thanked: 5 times
Dream Kudos: 50
My Contributions
simplify the problems by moving main() to the end of the code (you had missing function prototypes) - you should then be able to figure out the remaining errors, e.g.
CODE

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

//void computeStudAver(const int grade[][numQuiz], double stAve[]);
//void computeQuizAver(const int grade[][numQuiz], double quizAve[]);
//void printall(const int grade[][numQuiz],

int menu();


int menu()
{
    int choice;
    cout << "S. Start a new semester."<<endl;
    cout << "O. Output Data."<<endl;
    cout << "E. Exit"<<endl;
    cin >> choice;
    cout << endl << endl;;
    return choice;
}

int calcgrade(double average, char& grade)
{
    if (average <= 59)
    grade = 'F';
    if (average <= 69 && average >= 60)
    grade = 'D';
    if (average <= 79 && average >= 70)
    grade = 'C';
    if (average <= 89 && average >= 80)
    grade = 'B';
    if (average >= 90 && average <= 100)
    grade = 'A';
    return 0;
}

void inputgrades(const int grade[][totalGrades], int g[]) {
     cout << "How many grades will you add per student?";
     cin >> quizN;
     for (g = 1; g <= quizN; g++;)
         cout << "Enter the students' grade: " << endl;
         cin >> g;
}

void computeStudAver(const int grade[][numQuiz], double stAve[]) {
     for (int stN = 1; stN <= numStudents; stNum++) {
         double sum = 0;
         for (int quizNum = 1; quizNum <= numQuiz; quizNum++)
             sum = sum + grade[stNum-1][quizNum-1];
         stAve[stNum-1] = sum/numQuiz;
         }
}

void computeQuizAver(const int grade[][quizNum], double quizAve[]) {
     for (int quizNum = 1; quizNum <= numQuiz; quizNum++) {
         double sum = 0;
         for (int stN = 1; stN <= numStudents; stN++)
             sum = sum + grade[stN-1][quizNum-1]
         quizAve[quizNum-1] = sum/numStudents;
     }
}

void printall(const int grade[][numQuiz], const double stAve[], const double quizAve[]) {
     cout.setf(ios.fixed);
     cout.setf(ios.showpoint);
     cout.precision(1);
    
     outFile.open("C:\\Documents and Settings\\grafxx\\Desktop\\output1.txt");
     outFile << setw(10) << "Student" << setw(5) << "Average" << setw(15) << "Quizzes\n";
     for (int stN = 1; stN <= numStudents; stN++) {
              cout << setw(10) << stN << setw(5) << stAve[stN-1] << " ";
         for (int quizNum = 1; quizNum <= numQuiz; quizNum++)
             cout << setw(5) << grade[stN-1][quizNum-1];
         cout << endl;
         }
     cout << "Quiz averages = ";
     for (int quizNum = 1; quizNum <= numQuiz; quizNum ++)
         cout << setw(5) << quizAve[quizNum-1];
     cout << endl;
}

int main()
{
    const int numStudents = 5, numQuiz = 10, numAssign = 10, numFinal = 1;
    const int totalGrades = 21;
    int grade[numStudents][numQuiz];
    double stAve[numStudents];
    double quizAve[numQuiz];
    
    int choice = menu();
    while(choice != 3)
    {
        choice = menu();
        switch(choice)
        {
        case 1:
            cout << "Welcome. You have started a new semester! To start the grading process, press any key to continue."; // ** added;
            inputgrades();
            break;

        case 2:
            printall(grade[][numQuiz], stAve[], quizAve[]);
            break;

        case 3:
            cout << "Quitting..." << endl;
            break;
        }
    
    computeStudAver(grade, stAve);
    computeQuizAver(grade, quizAve);
    printall(grade, stAve, quizAve);
    return 0;
}


User is offlineProfile CardPM
+Quote Post

pngrafxx126
RE: C++ GradeBook -- Need Help
23 Feb, 2007 - 05:11 AM
Post #3

New D.I.C Head
*

Joined: 7 Nov, 2006
Posts: 33


My Contributions
OK, I did that and this is what I have fixed so far.

CODE

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

const int numStudents = 5, numQuiz = 10, numAssign = 10, numFinal = 1;
const int totalGrades = 21;
//void computeStudAver(const int grade[][numQuiz], double stAve[]);
//void computeQuizAver(const int grade[][numQuiz], double quizAve[]);
//void printall(const int grade[][numQuiz],

int menu();
int menu()
{
    int choice;
    cout << "S. Start a new semester."<<endl;
    cout << "O. Output Data."<<endl;
    cout << "E. Exit"<<endl;
    cin >> choice;
    cout << endl << endl;;
    return choice;
}

int calcgrade(double average, char& grade)
{
    if (average <= 59)
    grade = 'F';
    if (average <= 69 && average >= 60)
    grade = 'D';
    if (average <= 79 && average >= 70)
    grade = 'C';
    if (average <= 89 && average >= 80)
    grade = 'B';
    if (average >= 90 && average <= 100)
    grade = 'A';
    return 0;
}

void inputgrades(const int grade[][totalGrades], double g[]) {
     int quizN;
     cout << "How many grades will you add per student?";
     cin >> quizN;
     for (int i = 0; i <= quizN; i++) {
         cout << "Enter the students' grade: " << endl;
         cin >> g[i];
         }
}

void computeStudAver(const int grade[][numQuiz], double stAve[]) {
     int stNum;
     for (int stN = 1; stN <= numStudents; stNum++) {
         double sum = 0;
         for (int quizNum = 1; quizNum <= numQuiz; quizNum++)
             sum = sum + grade[stNum-1][quizNum-1];
         stAve[stNum-1] = sum/numQuiz;
         }
}

void computeQuizAver(const int grade[][numQuiz], double quizAve[]) {
     for (int quizNum = 1; quizNum <= numQuiz; quizNum++) {
         double sum = 0;
         for (int stN = 1; stN <= numStudents; stN++)
             sum = sum + grade[stN-1][quizNum-1];
         quizAve[quizNum-1] = sum/numStudents;
     }
}

void printall(const int grade[][numQuiz], const double stAve[], const double quizAve[]) {
     cout.setf(ios::fixed);
     cout.setf(ios::showpoint);
     cout.precision(1);
    
     ofstream outFile;
    
     outFile.open("C:\\Documents and Settings\\grafxx\\Desktop\\output1.txt");
     outFile << setw(10) << "Student" << setw(5) << "Average" << setw(15) << "Quizzes\n";
     for (int stN = 1; stN <= numStudents; stN++) {
              cout << setw(10) << stN << setw(5) << stAve[stN-1] << " ";
         for (int quizNum = 1; quizNum <= numQuiz; quizNum++)
             cout << setw(5) << grade[stN-1][quizNum-1];
         cout << endl;
         }
     cout << "Quiz averages = ";
     for (int quizNum = 1; quizNum <= numQuiz; quizNum ++)
         cout << setw(5) << quizAve[quizNum-1];
     cout << endl;
}

int main()
{
    int grade[numStudents][numQuiz];
    double stAve[numStudents];
    double quizAve[numQuiz];
    
    int choice = menu();
    while(choice != 3)
    {
        choice = menu();
        switch(choice)
        {
        case 1:
            cout << "Welcome. You have started a new semester! To start the grading process, press any key to continue."; // ** added;
            inputgrades();
            break;

        case 2:
            printall(grade[][numQuiz], stAve[], quizAve[]);
            break;

        case 3:
            cout << "Quitting..." << endl;
            break;
        }
    
    computeStudAver(grade, stAve);
    computeQuizAver(grade, quizAve);
    printall(grade, stAve, quizAve);
    return 0;
}
}


These are the errors I got in compiling.
In function `void printall(const int (*)[10], const double*, const double*)':
84: error: aggregate `std::ofstream outFile' has incomplete type and cannot be defined

In function `int main()':
50: error: too few arguments to function `void inputgrades(const int (*)[21], double*)'
114: error: at this point in file
118: error: expected primary-expression before ']' token
118: error: expected primary-expression before ']' token
118: error: expected primary-expression before ']' token

I don't know what's wrong up to this point.

This post has been edited by pngrafxx126: 23 Feb, 2007 - 05:41 AM
User is offlineProfile CardPM
+Quote Post

qdoom
RE: C++ GradeBook -- Need Help
23 Feb, 2007 - 06:36 AM
Post #4

D.I.C Head
**

Joined: 31 Aug, 2006
Posts: 82


My Contributions
QUOTE
In function `void printall(const int (*)[10], const double*, const double*)':
84: error: aggregate `std::ofstream outFile' has incomplete type and cannot be defined

1. You need to include <fstream>
CODE
#include <fstream>

2. It's not necessary, but I would suggest giving ofstream a value.
CODE
ofstream outFile ("data.txt");

That way, it calls the .open() function as a part of the constructor.

This post has been edited by qdoom: 23 Feb, 2007 - 06:38 AM
User is offlineProfile CardPM
+Quote Post

horace
RE: C++ GradeBook -- Need Help
23 Feb, 2007 - 07:37 AM
Post #5

D.I.C Addict
Group Icon

Joined: 25 Oct, 2006
Posts: 573



Thanked: 5 times
Dream Kudos: 50
My Contributions
fix the fstream as indicated by qdoom - in addition you define inputgrades() with parameters
CODE

void inputgrades(const int grade[][totalGrades], double g[]) {

but call it without parameters
CODE

        case 1:
            cout << "Welcome. You have started a new semester! To start the grading process, press any key to continue."; // ** added;
            inputgrades();      <<<<<< ??????
            break;

also the call to printall should look like

CODE

        case 2:
            printall(grade, stAve, quizAve);
            break;

fix those and it may compile
User is offlineProfile CardPM
+Quote Post

pngrafxx126
RE: C++ GradeBook -- Need Help
23 Feb, 2007 - 08:53 AM
Post #6

New D.I.C Head
*

Joined: 7 Nov, 2006
Posts: 33


My Contributions
OK I fixed all errors thanks to you guys =]. It compiles!

One thing remains now. When I run my program, and I choose any: S, O, or E. The program terminates. Something is wrong and I don't know what.


This post has been edited by pngrafxx126: 23 Feb, 2007 - 09:13 AM
User is offlineProfile CardPM
+Quote Post

pngrafxx126
RE: C++ GradeBook -- Need Help
23 Feb, 2007 - 09:29 AM
Post #7

New D.I.C Head
*

Joined: 7 Nov, 2006
Posts: 33


My Contributions
I get major errors between my menu() and my main()

Menu() Code:
CODE

int menu()
{
    char choice;
    cout << "S. Start a new semester."<<endl;
    cout << "O. Output Data."<<endl;
    cout << "E. Exit"<< endl << endl;
    cin >> choice;
    cout << endl << endl;
    return choice = main();
}



main() Code:
CODE

int main()
{
    int grade[numStudents][numQuiz];
    double stAve[numStudents];
    double quizAve[numQuiz];
    
    //choice = menu();
    //while(choice != 3)
    //{
        char choice;
        switch(choice)
        {
        case "S": // line 104
        case "s": // line 105
            cout << "Welcome. You have started a new semester! To start the grading process, press any key to continue."; // ** added;
            inputgrades();
            break;

        case "O": // line 110
        case "o": // line 111
            printall(grade, stAve, quizAve);
            break;

        default:
            cout << "Quitting..." << endl;
            break;
        } // line 118
    
    computeStudAver(grade, stAve);
    computeQuizAver(grade, quizAve);
    printall(grade, stAve, quizAve);
    return 0;
}


(104) : error C2051: case expression not constant
(105) : error C2051: case expression not constant
(110) : error C2051: case expression not constant
(111) : error C2051: case expression not constant
(118) : warning C4065: switch statement contains 'default' but no 'case' labels
Error executing cl.exe.

gradebook.obj - 4 error(s), 1 warning(s)

This post has been edited by pngrafxx126: 23 Feb, 2007 - 09:31 AM
User is offlineProfile CardPM
+Quote Post

Falke
RE: C++ GradeBook -- Need Help
23 Feb, 2007 - 10:03 AM
Post #8

New D.I.C Head
*

Joined: 7 Dec, 2006
Posts: 14


My Contributions
this is an simple/hard to catch mistake.
your code:
CODE
        switch(choice)
        {
        case "S": // line 104
        case "s": // line 105
            cout << "Welcome. You have started a new semester! To start the grading process, press any key to continue."; // ** added;
            inputgrades();
            break;

        case "O": // line 110
        case "o": // line 111
            printall(grade, stAve, quizAve);
            break;


what needs to change is the " you have in the case statement they should be '

like this:
CODE
        switch(choice)
        {
        case 'S': // line 104
        case 's': // line 105
            cout << "Welcome. You have started a new semester! To start the grading process, press any key to continue."; // ** added;
            inputgrades();
            break;

        case 'O': // line 110
        case 'o': // line 111
            printall(grade, stAve, quizAve);
            break;

User is offlineProfile CardPM
+Quote Post

pngrafxx126
RE: C++ GradeBook -- Need Help
23 Feb, 2007 - 10:11 AM
Post #9

New D.I.C Head
*

Joined: 7 Nov, 2006
Posts: 33


My Contributions
Yeh, I realized that lol. I fixed it before you posted, thanks anyway.

The problem I'm having now is inputting the grades into memory.

That's 5 grades for each of the 10 students. My program isn't working the way I want it to. I don't know what's wrong. If anyone can discuss this with me. Please AIM me @ pinoyngraphix.

This program is giving me a really hard time now.

This post has been edited by pngrafxx126: 23 Feb, 2007 - 10:15 AM
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: C++ GradeBook -- Need Help
23 Feb, 2007 - 10:14 AM
Post #10

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,351



Thanked: 51 times
Dream Kudos: 25
My Contributions
Can you describe the undesired behaviour?
User is online!Profile CardPM
+Quote Post

pngrafxx126
RE: C++ GradeBook -- Need Help
23 Feb, 2007 - 11:48 AM
Post #11

New D.I.C Head
*

Joined: 7 Nov, 2006
Posts: 33


My Contributions
Well when you run my program. It gives you the right choices and everything. It's just that when you choose S it doesn't do the desired behavior.

The behavior is as follows:
- Choosing S should start a new semester.
- The cmd then asks the user for how many quizzes. Given the amount it loops right, but I can't get each grade to stay in memory for the output and add each score to the previous quiz grade for a quiz total. The quiz grade taken is then averaged and then weighted to the grading scales.

The scales is Final = 35% grade, Assignments = 40%, and Quiz Grades = 25% to equal 100%.

After the quiz grades are taken, it should then ask for how many assignments there are. The loop works, but again the problem here is I can't get the score to stay in memory for the output and also add each assignment grade to the previous. The total assignment grades is again, averaged and then put into the scales.

The Final is the same. It asks for the grade and then scales it.

The ending result should be a data.txt file in an array format (which I'm sure I formatted right). It is supposed to show a data array of each student (1-10) with their corresponding grades from left to right in chronological order, and at the bottom would be their quiz averages. Their real letter grade and the average of each student would be at the bottom of the table, and the student average should be at the end of each row of student grades.


-----> My code consists of all the necessary functions, the problem with my program is it doesn't flow and the program terminates. If you don't get what I mean. Compile the code yourself and see what you get.

CODE

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

const int numStudents = 5, numQuiz = 10, numAssign = 10, numFinal = 1;
const int totalGrades = 21;
//void computeStudAver(const int grade[][numQuiz], double stAve[]);
//void computeQuizAver(const int grade[][numQuiz], double quizAve[]);
//void printall(const int grade[][numQuiz],

int menu();
int main();

int menu()
{
    char choice;
    cout << "S. Start a new semester."<<endl;
    cout << "O. Output Data."<<endl;
    cout << "E. Exit"<< endl << endl;
    cin >> choice;
    cout << endl << endl;
    return choice = main();
}

int calcgrade(double average, char& grade)
{
    if (average <= 59)
    grade = 'F';
    if (average <= 69 && average >= 60)
    grade = 'D';
    if (average <= 79 && average >= 70)
    grade = 'C';
    if (average <= 89 && average >= 80)
    grade = 'B';
    if (average >= 90 && average <= 100)
    grade = 'A';
    return 0;
}

//void scales() { // Final = 33%; Quizzes = 33%; Assignments = 33%
//    int quiz = .3 * qgrade = double q
    

void inputgrades() {
    char fanswer;
    int quizN, assignG, final;
    double qgrade[4], agrade[4], fgrade[1];
    
    cout << "How many quiz grades will you add per student?";
    cin >> quizN;
    for (int i = 0; i <= quizN; i++) {
         cout << "Enter quiz grade: " << endl;
         cin >> ++qgrade[i];
    qsum =+qgrade;
    }

    cout << "How many assignment grades will you add per student?";
    cin >> assignG;
    for (int i = 0; i <= assignG; i++) {
         cout << "Enter assignment grade: " << endl;
         cin >> agrade[i];
    }

    cout << "Is there a final?";
    cin >> fanswer;
    if (fanswer == 'y' || fanswer == 'Y')
         cout << "Enter final grade: " << endl;
         cin >> fgrade[i];
    }

    scales();
}

void computeStudAver(const int grade[][numQuiz], double stAve[]) {
     int stNum;
     for (int stN = 1; stN <= numStudents; stNum++) {
         double sum = 0;
         for (int quizNum = 1; quizNum <= numQuiz; quizNum++)
             sum = sum + grade[stNum-1][quizNum-1];
         stAve[stNum-1] = sum/numQuiz;
         }
}

void computeQuizAver(const int grade[][numQuiz], double quizAve[]) {
     for (int quizNum = 1; quizNum <= numQuiz; quizNum++) {
         double sum = 0;
         for (int stN = 1; stN <= numStudents; stN++)
             sum = sum + grade[stN-1][quizNum-1];
         quizAve[quizNum-1] = sum/numStudents;
     }
}

void printall(const int grade[][numQuiz], const double stAve[], const double quizAve[]) {
     cout.setf(ios::fixed);
     cout.setf(ios::showpoint);
     cout.precision(1);
    
     ofstream outFile ("GRADEDATA.txt");
    
     outFile.open("C:\\Documents and Settings\\kfg5\\Desktop\\output1.txt");
     outFile << setw(10) << "Student" << setw(5) << "Average" << setw(15) << "Quizzes\n";
     for (int stN = 1; stN <= numStudents; stN++) {
              cout << setw(10) << stN << setw(5) << stAve[stN-1] << " ";
         for (int quizNum = 1; quizNum <= numQuiz; quizNum++)
             cout << setw(5) << grade[stN-1][quizNum-1];
         cout << endl;
         }

     cout << "Quiz averages = ";
     for (int quizNum = 1; quizNum <= numQuiz; quizNum ++)
         cout << setw(5) << quizAve[quizNum-1];
     cout << endl;
}

int main()
{
    int grade[numStudents][numQuiz];
    double stAve[numStudents];
    double quizAve[numQuiz];
    
    char choice;
    cout << "S. Start a new semester."<<endl;
    cout << "O. Output Data."<<endl;
    cout << "E. Exit"<< endl << endl;
    cin >> choice;
    cout << endl << endl;

        switch(choice)
        {
        case 'S':
        case 's':
            cout << "Welcome. You have started a new semester!\n";
            inputgrades();
            break;

        case 'O':
        case 'o':
            printall(grade, stAve, quizAve);
            break;

        case 'E':
        case 'e':
            cout << "Quitting..." << endl;
            break;

        default:
            cout << "You must pick one to continue!" << endl;
            break;
        }
    
    computeStudAver(grade, stAve);
    computeQuizAver(grade, quizAve);
    printall(grade, stAve, quizAve);
    return 0;
}

User is offlineProfile CardPM
+Quote Post

Amadeus
RE: C++ GradeBook -- Need Help
23 Feb, 2007 - 12:03 PM
Post #12

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,351



Thanked: 51 times
Dream Kudos: 25
My Contributions
I'm a little surprised that the code compiles. You have two main functions declared. another are of concern is that you seem to be using a variable name qsum in your inputgrades() function, but the variable is not set in the function scope, nor is it declared at a global level. you are also calling your main function from your menu function, which is not a good idea - the main function should be the single program entry point.

what compiler are you using?
User is online!Profile CardPM
+Quote Post

2 Pages V  1