#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
struct student {
string name;
int age;
float prelim, midterm, endterm;
} ;
float compute_grade( float * prelim, float * midterm, float * endterm)
{
float solve = 0.00 ;
string remarks;
solve = ( * prelim* 0.30 ) + ( * midterm+ 0.30 ) + ( * endterm* 0.40 ) ;
if ( solve >= 75.00 ) {
remarks = "PASSED" ;
}
else {
remarks = "FAILED" ;
}
cout << fixed;
cout << setprecision ( 2 ) ;
cout << "\n \n \t The student grade is" << solve << setw( 15 ) << "Remarks: " << setw( 3 ) << remarks << "." ;
return ( solve) ;
}
int main( ) {
student user;
float * mypointer;
system ( "COLOR F0" ) ;
cout << "\n " ;
cout << "\t \t SIMPLE GRADE DOLVER 1.0" ;
cout << "\n \n " ;
cout << "\t Enter The Name of the student: " ;
getline ( cin , user.name ) ;
cout << "\n " ;
cout << "\t Enter The age of the Student: " ;
cin >> user.age ;
cout << "\n " ;
cout << "\t Enter the prelim grade" ;
cin >> user.prelim ;
mypointer = & user.prelim ;
cout << "\n " ;
cout << "\t Enter the midterm grade: " ;
cin >> user.midterm ; mypointer = & user.midterm ;
cout << "\n " ;
cout << "\t Enter endterm grade: " ;
cin >> user.endterm ;
mypointer = & user.endterm ;
cout << "\n \n " ;
cout << "\t ==== GENERATED REPORT ====" ;
cout << "\n \n " ;
cout << "\n \t student name: " << user.name ;
cout << "\n \t student age: " << user.age ;
compute_grade ( & user.prelim , & user.midterm , & user.endterm ) ;
cout << "\n \n " ;
system ( "pause" ) ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8aW9tYW5pcD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKc3RydWN0IHN0dWRlbnQgewpzdHJpbmcgbmFtZTsKaW50IGFnZTsKZmxvYXQgcHJlbGltLCBtaWR0ZXJtLCBlbmR0ZXJtOwp9OwpmbG9hdCBjb21wdXRlX2dyYWRlKGZsb2F0KnByZWxpbSwgZmxvYXQqbWl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