I am writing a program which takes in marks and manipulates the marks according to the menu selection.
I am new to programming and need a push in the right direction! My current issue isn't much that my program may be incorrect (syntax wise) its that nothing is being displayed for CASES 1.
THANK YOU!
Code:#include <iostream> #include <string> #include <iomanip> #include <cstring> using namespace std; int AddStudM (int Studm[], int MaxM=1000); // prototypes above. int main () { int loop=1; int choice; while (loop==1) { system ("CLS"); //Question 3 cout << " ** MENU **\n\n" << "0. Exit \n" << "1. Add Student mark \n" << "2. List all student marks \n" << "3. Calculate the marks average \n" << "4. Calculate the standard deviation \n" << "5. Delete a student mark \n" << "6. find the number of students via mark \n" << "7. Display distinct marks and their occurrences \n"; cout << "\n\nSelect from the menu above: "; cin >> choice; switch(choice) { case 0: cout << "Good bye\n\n"; system ("pause"); exit(0); case 1: system ("CLS"); int AddStudM (int Studm[], int MaxM); system ("pause"); system ("CLS"); main(); break; case 2: system("CLS"); cout << "\t-- List all student marks --\n\n"; system ("pause"); system("CLS"); break; case 3: system("CLS"); cout << "\t-- Calculate the marks average --\n\n"; system ("pause"); system("CLS"); break; case 4: system("CLS"); cout << "\t-- Calculate the standard deviation --\n\n"; system ("pause"); break; case 5: system("CLS"); cout << "\t-- Delete a student's mark --\n\n"; system ("pause"); system("CLS"); break; case 6: system("CLS"); cout << "\t-- Find the number of students via a mark --\n\n"; system ("pause"); system("CLS"); break; case 7: system("CLS"); cout << "\t-- Display distinct marks and thei occurrences --\n\n"; system ("pause"); system("CLS"); break; } } } // 1. Add a student mark! int AddStudM (int Studm[], int MaxM) int Mark; int i; for (i=0; i< MaxM; i++) { cout << "enter mark for student: "; cin >> Mark; Studm[i]=Mark; } i++; return 0; } }



LinkBack URL
About LinkBacks


