Aaron Best

Greenhorn
+ Follow
since Mar 31, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Aaron Best

Yeah, sorry about that everyone. I had a few problems that had to be dealt with. As far as the code goes, I've revised it. As far as Maps and Lists go, I'm afraid that's beyond my level of skill.. I had a little help from a friend, who told me to make strings for each range and my code came out like this:



Now, there's one last problem. A new addition to this assignment is, if I understood it right, to output the data I get from running the program to a new file, like "GPA2.txt". I believe my professor wants me to use PrintWriter, but I'm not entire sure I understand how it works. I know the constructor for it:


But I don't understand how the parameters work here. Once I figure this out, get in my code, and print my output to a new file, I'll be officially done. So I must again ask for your assistance here, everyone. ^_^;
13 years ago
Hello, JavaRanch. My name's Aaron, and as this thread's title states, a newbie to the Java world. I understand a little about Java after 9 weeks of classes/labs, even more since I have a few friends who can help. I'm here today to ask for assistance regarding a code I'm working on now. The situation is, I need to read data from an external text file (which I've already completed), break the contents into tokens with StringTokenizer (also completed), then output the data in the format:

Students with grades of X between Y:
LastName FirstName Grade
LastName FirstName Grade
... and so on



I need to do this for the following ranges; 69 and below, 70 to 79, 80 to 89, and 90 to 100 (I've also done this). But the problem is, the output is all screwed up. Here's the code:


The output turns out like this:



See what I mean? What I'm trying to do is get it so each person is under the correct range without the range showing up so many times. I also need to output the names of people who don't have any grades available, but those turn out as Exceptions. Can anyone give me a hand here? Thanks in advance.
13 years ago