0% found this document useful (0 votes)
6 views1 page

Programming

Uploaded by

vutominhlamulo8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Programming

Uploaded by

vutominhlamulo8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Vutomi Nhlamulo Mkabi 240126335

#include <iostream>
using namespace std;

// Function to calculate the final mark


double calculateFinalMark(double predicateMark, double examMark) {
return (predicateMark * 0.4) + (examMark * 0.6);
}

int main() {
double predicateMark, examMark, finalMark;

cout << "Enter the predicate mark (0-100): ";


cin >> predicateMark;

if (predicateMark >= 40) {l


cout << "Student qualifies to write the exam.\n";
cout << "Enter the exam mark (0-100): ";
cin >> examMark;

finalMark = calculateFinalMark(predicateMark, examMark);

cout << "Final mark: " << finalMark << "%\n";


if (finalMark >= 50) {
cout << "Result: Passed\n";
} else {
cout << "Result: Failed\n";
}
} else {
cout << "Student does not qualify to write the exam.\n";
}

return 0;
}

You might also like