Clark James

Greenhorn
+ Follow
since Jun 14, 2015
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Clark James

Stefan Evans wrote:Hi! Welcome to the ranch.

Yeah, as Tushar has pointed out, it helps if you UseCodeTags. <--- click to find out how.
I've put them in for you this time - see how much better it looks?


There are a couple of minor compile errors in there
- missing import for scanner class
- missing an opening { for your class.

Once those are sorted your program should compile and run .

You do have a problem in the code that inputs the names.
Your print method looks ok though. I would suggest calling it after you have finished entering names just to show you what the user entered before sorting.
Or maybe even printing them names after you have entered EACH name .
That should help you get a handle on what is going on in your program.


Stefan,

After reading your comments I started looking at my Name and Grade input and finally got it working. I simply added i++; after the Grade input line and it finally accepted and printed all five names and grades out of the parallel arrays.
Thanks for your help. I'm only a couple months into Java and this had me stumped for a few days.

9 years ago
See if it compiles now. I'm using NetBeans and it does compile there but I left out the top couple lines previously.

9 years ago
My program is suppose to accept up to 5 names and grades and it does that but when I try to sort them by Name or Grade and then try print them out I am only getting the last name and grade entry made. I'm pretty sure the problem is with my counter but I can't seem to figure it out. Any help would be appreciated it.
9 years ago