Need help on reading input

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Apr 2008
Posts: 108
Reputation: christiangirl is an unknown quantity at this point 
Solved Threads: 1
christiangirl christiangirl is offline Offline
Junior Poster

Re: Need help on reading input

 
0
  #11
Nov 19th, 2008
you could try subtracting one
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 108
Reputation: christiangirl is an unknown quantity at this point 
Solved Threads: 1
christiangirl christiangirl is offline Offline
Junior Poster

Re: Need help on reading input

 
0
  #12
Nov 19th, 2008
where does it add one at?
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 79
Reputation: orangejuice2005 is an unknown quantity at this point 
Solved Threads: 0
orangejuice2005 orangejuice2005 is offline Offline
Junior Poster in Training

Re: Need help on reading input

 
0
  #13
Nov 20th, 2008
Here, I have the most updated code attached. You should run it and see what am talking about. You'll understand what am trying to say better.
Attached Files
File Type: java SummarizeResults.java (2.0 KB, 1 views)
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 108
Reputation: christiangirl is an unknown quantity at this point 
Solved Threads: 1
christiangirl christiangirl is offline Offline
Junior Poster

Re: Need help on reading input

 
1
  #14
Nov 20th, 2008
All you need to do is in the last for loop, make it go till j < i instead of j <=i.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 79
Reputation: orangejuice2005 is an unknown quantity at this point 
Solved Threads: 0
orangejuice2005 orangejuice2005 is offline Offline
Junior Poster in Training

Re: Need help on reading input

 
0
  #15
Nov 20th, 2008
Thanks! That solution made sense. I don't know why i didn't think of it. The number 0 ends up being the last entry in the array and instead of including it in the printout all I had to do was stop one short of that entry. This is now an officially solved thread. Am Repping you accordingly. And yea, am terrible at coding. For you see the pseudo code was given to me and am still trying to understand how those switch statements keep track of the severity for each problem. I'll just ask a classmate to explain it to me.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 108
Reputation: christiangirl is an unknown quantity at this point 
Solved Threads: 1
christiangirl christiangirl is offline Offline
Junior Poster

Re: Need help on reading input

 
0
  #16
Nov 20th, 2008
Glad to help! You can message me questions any time you want!

The switch statement pretty much does something based on what is entered, it "switches" betwen different options. If a 1 is entered it goes to option 1, if 2 entered it goes to option 2. then it does the code under that option.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC