Python
#include <iostream> #include <iomanip> using namespace std; void get_input(int *); void calc_total(int *,double *); void getLowest(int *, int *); void getadjTotal(int *, double *, double *); void comp_avg(double *, double *); void dis_results(int *, double *, int *, double *, double *); int main() { int test_score[5]; double total1 = 0.0, average = 0.0; int lowestScore = 0.0; double adjTotal = 0.0; get_input(test_score); calc_total(test_score, &total1); getLowest(&lowestScore, test_score); getadjTotal(&lowestScore,&total1, &adjTotal ); comp_avg(&adjTotal, &average); dis_results(test_score, &total1, &lowestScore, &adjTotal, &average ); return 0; } void get_input(int *p1) { cout << "Enter the five scores"; for (int i =0; i < 5; i++) { cin>> *p1; p1++; } } void calc_total(int *p2, double *t1) { for (int ii=0; ii < 5; ii++) { *t1 += *p2; p2++; } } void getLowest(int *l, int *t) { *l = *t; t++; for (int count = 1; count < 5; count++) { if (*t < *l) *l = *t; t++; } } void getadjTotal(int *ls, double *t2, double *at) { *at= *t2-*ls; } void comp_avg(double *pf, double *oq) { *oq = *pf / 4.0; } void dis_results(int *r1, double *r2, int *r3, double *r4, double *r5) { cout<<"The five scores of the tests for the student are: "<<endl; for (int r=0; r < 5; r++) { cout<< *r1<<endl; r1++; } cout<< endl; cout<<"The total of five scores is: "<<endl; cout<< *r2<<endl; cout<< endl; cout<<"The lowest score of five scores is: "<<endl; cout<< *r3<<endl; cout<< endl; cout<<"The adusted total of five scores minus the lowest score is: "<<endl; cout<< *r4<<endl; cout<< endl; cout<<"The average of the four highest scores is: "<<endl; cout<< *r5<<endl; cout<< endl; }