We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,676 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Manipulating file data

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
13 Minutes
Discussion Span
1 Year Ago
Last Updated
3
Views
Prisms
Light Poster
30 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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

JamesCherrill
... trying to help
Moderator
8,505 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,454
Skill Endorsements: 29

Thanks for the help I will give that a try.

Prisms
Light Poster
30 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0629 seconds using 2.72MB