# Assignment Of A Computer System

1186 Words5 Pages
student *st; float update1, update2, update3, update4; assessment *stable = arr.record[count].head; if (compare == 1) { do { loop: type(); int option; cin >> option; if (option == 1) { while ((strcmp(stable->type.c_str(), "Quiz") != 0) && stable!= NULL) { stable = stable->next; if (stable == NULL) { cout << "record not found\n"; compare = 0; break; } } if (compare == 1) { cout << "Current percentage of Quiz : " << stable->pctg << endl; cout << "Enter quiz mark : " << endl; cin >> update1; while (update1 > 40.00 || update1 < 0) { cout << "MARK MUST BE BETWEEN 0 AND 40 ! " << endl; cout << "Mark : "; cin >>…show more content…
" << endl; cout << "Mark : "; cin >> update2; } float pctg; float percentage = (update2 / 10) * 10; stable->pctg = percentage; cout << "Percentage of Assignment : " << stable->pctg << endl; } } else if (option == 4) { int compare = 1; while ((strcmp(stable->type.c_str(), "LabExercise") != 0)) { stable = stable->next; if (stable == NULL) { cout << "not found\n"; compare = 0; break; } } if (compare == 1) { cout << "Current percentage of Lab Exercise : " << stable->pctg << endl; cout << "Enter Lab Exercise mark : "; cin >> update4; while (update4 > 14.00 || update4 < 0) { cout << "MARK MUST BE BETWEEN 0 AND 14 ! " << endl; cout << "Mark : "; cin >> update4; } float pctg; float percentage = (update4 / 14) * 15; stable->pctg = percentage; cout << "Percentage of Lab Exercise : " << stable->pctg << endl; } } cout << "Do you want to update again [y/n] : "; cin >> looption1; if (looption1 == 'y') { goto loop; } } while (looption1 != 'n'); } else if (compare == 0) { cout << "Not Exist \n"; } } void save() { ofstream file; string filename; cout << "Enter file name : "; cin >> filename; filename = filename + ".txt";