// 22.5HV2 Software Engineering II // Unit 2 Exercise 3 #include #include #include #include "student.h" int student::split = 50; int student::pass = 40; student::student(char* n): course_work(0), exam(0) { strcpy(name,n); } void student::set_marks(int e, int c) { exam = e; course_work = c; } void student::show_result() { int mark = int(split/100.0*exam + (100-split)/100.0*course_work); cout << endl << name << endl; cout << "Total mark: " << setprecision(1) << mark << "%" << endl; if ( mark < pass ) cout << "FAIL" << endl; else cout << "PASS" << endl; } void student::set_split(int s) { split = s; } void student::set_pass(int p) { pass = p; }