
please wait
For research purposes and to better help students, the admissions office of your local university want to know how well female and male students perform in certain courses. You receive a file that contains female and male students GPA for certain courses. Due to confidentiality the letter code f is used for female students and m for male students. Every file entry consists of a letter code followed by a GPA. Each line has one entry. The number of entries in the file is unknown. Write a program that computes and outputs the average GPA for both female and male students. Format your results to two decimal places. a. Function openFiles: This function opens the input and out files, and sets the output of the floating point numbers to two decimal places in a fixed decimal format with a decimal point and trailing zeros. b. Function initialize: This function initializes variables such as countFemale, countMale, sumFemaleGPA, and sumMaleGPA. c. Function sumGrades: This function finds the sum of female and male students GPA d. Function averageGrade: This function finds the average GPA for female and male students e. Function printResults: This function outputs the relevant results. f. There can be no global variables. Use appropriate parameters to pass information in and out of functions |
|
|
|
|