Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Project
//Abeer alwafi & Salha alfar & Fizah #include <iostream> #include <cstring> using namespace std; int sum=0; double avg=0.0; int main() { // The N_Student mean the number of student int N_Student; cout<<"Enter number of students\n"; cin>> N_Student; string studentName[ N_Student]; for(int i=0;i<N_Student;i++) { cout<<"\n Enter the name of student #"<<i+1<<"\n"; cin>>studentName[i]; } // The N_Course mean the number of courses int N_Course; cout<<"\nEnter number of courses\n"; cin>>N_Course; string courses[ N_Course]; for(int i=0;i<N_Course;i++) { cout<<"\n Enter your courses #"<<i+1<<"\n"; cin>>courses[i]; } int StudentGrade[N_Student][N_Course]; int choice; do{ string menue=" 1.Add a students grade in a course.\n\n 2.Print grades for a certain course and the average of students’ grades in this course.\n\n 3.Print the grade letter for all courses of a certain student.\n\n 4.Update the grade of a student in a certain grade.\n\n 5.Delete a certain mark for certain student.\n\n 6.Exit.\n\n"; cout<<"\n\n\n The menue for students system \n\n\n\n"<<menue; // choice mean the number to choose from the menue cout<<"\n Enter your choice\n"; cin>>choice; switch(choice) {case 1: // the row mean the name of student and the col mean the courses for(int row=0;row<N_Student;row++) { for(int col=0;col<N_Course;col++){ cout<<"\n Enter \t "<<studentName[row]<<" grade in a course \t "<<courses[col]<<"\n"; cin>>StudentGrade[row][col]; } } break; case 2: // global int sum=0; int course; cout<<"\n courses: "; for(int col=0;col<N_Course;col++){ cout<<"\n"<<col+1<<" "<<courses[col]; } cout<<"\n Please choose the course from the list above \n"; cin>>course; if ((course <1) && (course > N_Course)) cout<< "\n Invalid course number"; else { // the row mean the name of student and the course mean the courses user choose cout<< courses[course]<<"\n"; for(int row=0;row<N_Student;row++){ cout<<StudentGrade[row][course]<<"\n"; sum = sum + StudentGrade[row][course]; } cout<<"\n ------------------------\n"; // global double avg=0.0; avg=sum/ N_Student; cout<<"\n The avrage = \t"<<avg; } break; case 3: break; case 4: break; case 5: break; case 6: break; default: cout<<"Invalid"; } }while(choice!=6); return 0; }
run
|
edit
|
history
|
help
0
What exactly is “broken” with Microsoft Visual C++'s two-phase template instantiation?
ntohl
error_check
5sdgts
Affine Key Finder and Decrypter
codecvt wide string conversion with multibyte chars and locale + concatenation
GetFinalPathNameByHandle Behaviour
operator new / delete
Data structure alignment
Hello World