0

Whats up everyone I have a question, but first of all I know how to read a file, write to it and all that good stuff I was wondering how do I manipulate data from one. I want to take this .txt file and compute the gpa by taking the student grade and and number of hours the course is out of the file and doing the math for them. How would I go about doing this I'm kind of stumped. Here is the .txt file.


A123456 John Doe
Term Fall 2011
CS 411 Object Oriented Programming
3 A
CS 211 Introduction to Programming
3 A
CS 560 Data Structures and Algorithms
3 B
CS 680 Software Engineering
3 B+

B654431 Jill Great
Term Fall 2011
CS 411 Object Oriented Programming
3 B+
CS 211 Introduction to Programming
3 A
CS 560 Data Structures and Algorithms
3 A
CS 680 Software Engineering
3 B+
Term Spring 2011
Eng 101 English
3 A
Phy 254 Physics I
3 B+

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by Prisms
0

If you know how to read a file then:
create a data structure in your program to hold the data you will read. eg You could have an arraylist of instances of a Student class that has name etc and a hashtable of courses/grades.
Read the file into the data structure.
Loop through the list of Students and for each student process his courses & grades to compute whatever

This topic 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.