• Post Reply Bookmark Topic Watch Topic
  • New Topic

Singly linked list not printing correctly.  RSS feed

 
Jorren Lenson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys. I need help with a project I am working on. Its a program that creates a singly linked list that stores names and high scores and prints them. For some reason it is printing an entry extra times. Also my remove function is not working properly can someone help me out? Thank you in advance. Here are my four classes. I just need a nudge in the right direction.



LinkedList class

Scoreboard class:


ScoreboardTest class:

Output:
The Original High Scores
[, (Flanders, 681), (Burns, 152), (Smithers, 150), (Apoo, 648), (Maggie, 980), (Lisa, 506), (Homer, 12), (Bart, 875), (Otto, 438), (Krusty, 324), (Krusty, 324), (Krusty, 324)]
Scores after adding Moe
[, (Flanders, 681), (Tyler, 0), (Burns, 152), (Smithers, 150), (Apoo, 648), (Maggie, 980), (Lisa, 506), (Homer, 12), (Bart, 875), (Otto, 438), (Krusty, 324), (Krusty, 324), (Krusty, 324)]
Scores after removing Apoo
[, (Flanders, 681), (Tyler, 0), (Burns, 152), (Smithers, 150), (Apoo, 648), (Maggie, 980), (Lisa, 506), (Homer, 12), (Bart, 875), (Otto, 438), (Krusty, 324), (Krusty, 324), (Krusty, 324)]
 
Norm Radder
Rancher
Posts: 2240
28
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!