Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java-4b

 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay, i know this one has been discussed to death, but i have a new question.
i tried not to read the previous posts because i did not want to spoil my learning experience... but i did notice some people talking about switch statements.
i wrote it last night using 4 methods ( plus main() ) that use if/else statements. one of the functions is recursive, and calls the other functions as necessary...
i am just curious if i am heading in the right direction with this one. anyone out there who has passed 4b using what i have described? it seems too easy, so i am sure i did something wrong!
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe the real key is to use as few if statements as possible. Placement is the key.
Matthew Phillips
 
Rick Prevett
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used a function (the function type started with an 'r' ), and I was nitpicked. If you want to read the nitpick, submit the function, but I didn't pass using it.
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the tips... i just noticed that c++ was trying to come out in my post above i said "methods" the first time, but then i digressed to "functions"... i cannot get away from it!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic