okay so we have to create a coursework submission system where students submit there assignments and the teacher can get the assignment grade it and send back to student and if they want to add ocmments they can add comments.. i am so lost with how to create a system function this is what i have so far for the project any help woulb be appreciated. I looked at the tuturials and other post by members to help me figure what i had out so far and understand it.

#include <iostream> 
#include <fstream> 
#include <string> 
void getcourseinfo(); 
void findAvg(); 
void giveGrade(); 
void output();

using namespace std;
float gradeavg = 0;
string studentname[200];
float score[200];
string grade[200];
signed int CW=-1; 
ofstream file;
string filename;


int main(void)
{
    system("color 0a"); 
    system("cls"); 
    cout << "|WELCOME TO STUDENT COURSE WORK SUBMISSION SYSTEM!!|" << endl;


const int NO_OF_STUDENTS = 25;
int getstudentcount ();
int getassignmentscores ();
int calculatepointgrades ();
int calculatelettergrades ();
int showgradedata ();
int arrayavg ();
double arrayave ();
int students[NO_OF_STUDENTS];
int assignmentscores[NO_OF_STUDENTS];
int A;
int assignment;
int main()

{
int getstudentcount ();
cout << "Enter the number of students" << endl;

for (int s = 0; s <= 25; s++)

{
int students (0);

return 0;
cout << "students[NO_OF_STUDENTS]";

}
int getassignmentscores ();
cout << "Enter the student assignment scores";
return 0;
for(int assignment = 0; assignment <= 10; assignment++)
{
int assignmentcores (0);
cout << "assignmentscores[NO_OF_STUDENTS]";
}

return 0;
}

It seems like you have two programs copy/pasted here, one inside of the other. That's not going to work. See if you can arrange it into one program. Reread the section in your book on functions as to how they are prototyped, defined, and called.

will do thanks!!

It seems like you have two programs copy/pasted here, one inside of the other. That's not going to work. See if you can arrange it into one program. Reread the section in your book on functions as to how they are prototyped, defined, and called.

okay id id what you suggested and this is what i have i dotn think its doen yet because i have errors and something undefined still lost about how to make if the choice ==s or S student inputassignment i have it but it says its a syntax error with the switch method

#include<iostream>
#include<fstream>
#include<string>
#include <cstdlib>


using namespace std;


const int NO_OF_STUDENTS = 25;
int main();
int menu()
{
    char choice;
    cout << "S for student or T for teacher"<<endl;
    cout << "O. Output Data."<<endl;
    cout << "E. Exit"<< endl << endl;
    cin >> choice;
    cout << endl << endl;
    return choice;
}

int main()
{
int inputassignment();
int getstudentcount ();
int calculatelettergrades ();
int students;
int assignment;
string assignment_grade_comment;


ifstream assignments;
ofstream outfile;

assignments.open("assignments.txt");
if (!assignments)
cout << "unable to open files" << endl;
cout << "automatically exits" << endl;
return 0;
}
 int getstudentcount(int student)
	 if(!NO_OF_STUDENTS)
return 0
	 else 
	 if(NO_OF_STUDENTS)
		return students
cout << "Enter the number of students" << students << endl ;

}

int inputassignment(ifstream assignments);
cout<< "Enter the assignment";
infile>> assignments;


return assignment
cout << "assignment[NO_OF_STUDENTS]" << assignment
}

return 0;
}
int calculatelettergrades(double average, char& grade)
{
    if (average <= 59)
    grade = 'F'
	cout<<"You need to work harder in order to pass the class"<<endl;
    else if (average <= 69 && average >= 60)
    grade = 'D'
cout<<"Still needs alot of improvement"<<endl;
    else if (average <= 79 && average >= 70)
    grade = 'C'
cout<<"Still needs some improvement but ok"<<endl;
    else if (average <= 89 && average >= 80)
    grade = 'B'
cout<<"Good job just recheck work"<<endl;
    else if (average >= 90 && average <= 100)
    grade = 'A'
cout<<"Excellent Job!"<<endl;
    return 0;

    
}

ofstream outFile ("coursework.txt");


 switch(choice)
        {
        case 'S':
        case 's':
	cout << "You have reached the student coursework submission part\n"
			inputassignment()
            break;
		case 'T':
        case 't':
            cout << "You have reached the Teacher interface please grade assignments\n";
            inputgrades();
            break;

        case 'O':
        case 'o':
            printall(grade);
            break;

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

        default:
            cout << "You must pick one to continue!" << endl;
            break;
        }
    
    return 0;
}

My suggestion to you is that first go though you code once again and you have to read book before creating project.
Because you have done a lots of silly mistake like missing semicolon(;), block ({,}) of function. So its to typical too help you in this stage.
I hope you understand

Your formatting is nice between 12 and 21, try to format the rest of your code like that, as it will be much easier to see where your mistakes are. As prvn has pointed out, you are missing a semicolon on one of your functions that you call in the switch block.

On lines 25-27 you have your function prototypes inside of main(). While the compiler may not complain, and it's not technically wrong, it's much more conventional to keep them before main.

You've done a nice job weeding out that other extraneous code from before. Keep going with it. Reference your text about functions and where to put the prototypes, definitions, and calls.

Make sure all of your function definitions begin and end with { and }

oh wow I see what you are talking about. I'll reread that section in my (c++ book) because it doesn't have that in my software engineering book. I'll make the changes then go back through it and then post it if still have problems.. thanks again for all the advice

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.