This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Cattle Drive and the fly likes Java-4b Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Java-4b" Watch "Java-4b" New topic


Greg Harris
Ranch Hand

Joined: Apr 12, 2001
Posts: 1012
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

Joined: Mar 09, 2001
Posts: 2676
I believe the real key is to use as few if statements as possible. Placement is the key.
Matthew Phillips

Matthew Phillips
Rick Prevett
Ranch Hand

Joined: Apr 16, 2001
Posts: 68
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

Joined: Apr 12, 2001
Posts: 1012
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!
I agree. Here's the link:
subject: Java-4b
Similar Threads
Java-4b Please
Question regarding Assignment 4b
4b structure
Say 4b - completely stumped
Say 4b just got harder...