Hi guys,

I'm not good at programming so would you help me with this?! No fancy codes, just make it simple.

Problem Statement

For research purposes and to better help students, the admissions office of my college wants to compare how well female and male students perform in certain courses. You are asked to write a program that reads student records from an input file. Each student record will consists of two data items: (a) the student’s sex (‘f’ for female, ‘m’ for male) and (b) the student’s GPA (a number in the range of 0.0 – 4.0).

Assume that the length of the input file is unknown. Therefore, the program should continue processing student records until the end of file is reached.

The program should tabulate the following information:

- total number of female students

- average female student’s GPA

- total number of male students

- average male student’s GPA

- total number of students

- overall student GPA (males and females combined)

A sample input file is shown below, followed by a sample screen shot of the program’s output. Your program should format its screen output as shown in this sample report. Note that GPA values should be written to two decimal places.

Sample Input File (student_data.txt)

f 3.40

f 2.83

m 3.21

f 4.00

x 3.52

m 3.12

m 2.10

m 3.42

f 3.80

m 5.26

f 3.25

Sample Program Output (user input is in italics):

Female Students....... 5

Female Avg GPA ....... 3.46

Male students ........ 4

Male Avg GPA ......... 2.96

Overall Avg GPA ...... 3.24

Thanks in advance,

5 Years
Discussion Span
Last Post by oybek

Hi guys,

I'm not good at programming so would you help me with this?! No fancy codes, just make it simple.

So you want us to provide you with the answer to this program? Just make it simple. Is that correct?


Then NO SIR! We are not a homework delivery forum. Why take the class if you don't want to bother to learn the language?


My major now is Information Systems and I took it because when I first came to college I didn't know what to study so my uncle suggested me Information Systems. But later I realized I like music so much. So next semester I'm going to change my major to Music and I won't need programming anymore. I'd like to drop off my C++ class but then I'll become a part time student therefore I will have to return money from financial aid which is already payed for school and I still haven't found job yet. The class is very boring for me(no disrespect). I do great in my other classes but this one seems like I'll fail it and ruin my overall GPA because of this class.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.