Kevin Tansey

Ranch Hand
+ Follow
since Dec 11, 2005
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 Kevin Tansey





and now I can sleep!
18 years ago


got the GPA right, I was dividing the QP by the wrong value (course credits instead of the sum of the credits).





now I just need to figure out whats wrong with my worstGradeIndex method
18 years ago
hmm

I wonder whats making the worst grade be null and the GPA to be so far off...



18 years ago
and yes the nullpointerexception is happening because of this getworstgradeindex loop, -1 is assigned initially to worst and the loop is not changing that value before worst is returned.
18 years ago
oh I have multiple versions of the student.java file saved, I'm not abandoning anything just trying different ideas


playing a little more I'm getting some output finally:



now my worstGradeIndex loop is failing, I was worried about that one.

this is how that method looks, I previously had the loop be a while loop using "worst" as the counter, is that the more correct way to do that loop?



thank you for all of your help
18 years ago
no worries, I know I need help
18 years ago
hmm, ok.

this is how it stands right now:



and it compiles correctly, but I get more warnings now:

"local variable title, numCredits is never read"

and when I run the program this is the output:
18 years ago
hmm, ok.

this is how it stands right now:



and it compiles correctly, but I get more warnings now:

"local variable title, numCredits is never read"

and when I run the program this is the output:
18 years ago


Well that certainly looks better.

Having a problem with the course.setGrade line though, its saying

The method setGrade(char) in the type Course is not applicable for the arguments (String)



I tried adding in:

But it didn't take that either, and there is no scanner.nextChar() method either?
18 years ago


Well that certainly looks better.

Having a problem with the course.setGrade line though, its saying

The method setGrade(char) in the type Course is not applicable for the arguments (String)



I tried adding in:

But it didn't take that either, and there is no scanner.nextChar() method either?
18 years ago

Originally posted by Jim Yingst:
just set it to a new value, namely the instance you're creating.



I'm not following
[ December 12, 2005: Message edited by: Kevin Tansey ]
18 years ago

Originally posted by Jim Yingst:
just set it to a new value, namely the instance you're creating.



I'm not following
[ December 12, 2005: Message edited by: Kevin Tansey ]
18 years ago
here's Course



The only problem I see with what you're saying is I was given the declaration of course already as:



so if I try "Course course = new Course();" that is just a duplicate. Everything above the chunks of //comments in the code I've given is instructor provided and not to be changed.
18 years ago
here's Course



The only problem I see with what you're saying is I was given the declaration of course already as:



so if I try "Course course = new Course();" that is just a duplicate. Everything above the chunks of //comments in the code I've given is instructor provided and not to be changed.
18 years ago
when you say constructing an instance of Course, do you mean an array?

course = (title + numCredits + grade);

so instead of that I should create something like:




18 years ago