• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I cannot win!

 
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
okay, i am on my 5th try at Java-4b (Say). i have tried this with 3 "if" statements... that was nitpicked. then i tried it with a "while loop"... that just got nitpicked.
the pick on the "if" statements was that i had 3 almost identical blocks of code... the pick on the "while loop" is that if a loop runs less than 5 times (3 in this case) then there is an easier way to do it... ("if" statements, right)?
what the heck am i supposed to do?!?! should i try a "switch" statement now? this is becomming a recursive process!
 
Ranch Hand
Posts: 111
jQuery Oracle C++
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greg, you can win and you will make it through the ever famous 4b. There are quite a few of us who know exactly what you are going through.
I think the direction you should take is to simply call your method three times passing in the correct parameters each time, you may have to change your method a little bit but maybe not. I'm not sure how much more I can hint at but I will let you know I understand where you are coming from with the frustration. Trust me, when you get the okay for this one it will be very satisfying.
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Amber! i think i have an idea now... we will see what happens.
 
Chicken Farmer ()
Posts: 1932
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I went through the exact same thing you are dealing with, reverse order. Started with for loops, then a while loop, then repeated if statements.
THEN I went into recursion, you want to talk about getting nitpicked!
You'll get it, and when you do, it will be, as Amber said, VERY rewarding. Listen to Marilyn, she knows what she is talking about... however vague that may be
Jason
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks, jason. i actually started with recursion... and yes, i did get nitpicked. marilyn said that recursion gets "cool points" but it is not a good idea. i was actually proud of that one.
oh well, i will see what happens to the one i sent this afternoon. hopefully this will be it! i already have the rest of the assignments completed... just waiting for the "okay" on 4b.
 
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry Greg but your thread made me chuckle
Good luck
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
whatever i can do to brighten your day, johannes! at least someone is benefiting from my stress...
 
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like Johannes and I have another dedicated recursion user. Marilyn will cure you of that habit. You'll still have the urge but you will learn to ignore it.
I actually got beat up on recursion in Java-1b. I tried it again in Java-4b. Still didn't pass. Listen to Amber, her advice is right on.
Good Luck!
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't feel bad, guys. I tried recursion, too, when I was on Assignment 4. Of course, I'm passing on to you what I learned.
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks, Marilyn... it helps to know the teacher has been here before and, apparently most of the cattle drive graduates.
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hooooodoggy! i passed 4b!
thanks for the hint, amber.
and, marilyn, thanks for having patience with my attempts!
 
Johannes de Jong
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congrats
 
reply
    Bookmark Topic Watch Topic
  • New Topic