• Post Reply Bookmark Topic Watch Topic
  • New Topic

program help  RSS feed

 
Jack Bolton
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i am coding this two programs that creates and reads a file from the hard drive; the program(1) that creates the file ask the user for name, id, age, and two grades, then the program(2) that reads the file display the name , id, age and the final grade of each student.
The problem i have is that i want that the program(2) that reads the file also displays which student has the highest final grade and which one has the lowest final grade.
How do i code this?
thanks for any response...



 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you have a maxScore variable, which you set at 0 in your constructor?
Then every time a score comes > maxScore, increase maxScore, and record the bestStudent String to record their name.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!