Need help starting a program.
I have to write a program that reads in a file of male and female GPAs, then gives me the avergae male gpa and average female gpa.
The text in the file will look like this:
f3.9
m4.0
f2.5
m3.4
Where the first character represents male or female and the number represents the gpa obviously. Can anyone point me in the right direction on how to start this?
Re: Need help starting a program.
You can read each line of the file and get the String's first index using string.charAt(int index).
If you are unsure how to read files here is an example: Java Read File Line By Line,How to Read File Line By Line in Java
Re: Need help starting a program.
Thanks, I'll give that a go.