• 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

Java-4b

 
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 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!
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
reply
    Bookmark Topic Watch Topic
  • New Topic