If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Java Program

This was an assignment in my CS151 Programming Fundamentals aka. Java class. Its supposed to be a cuckoo clock simulator. I know it pretty dumb, but I was wondering what the programming experts around here see that I can do to slim it down a little bit. In its current state it is over 5 pages long. By the way there is a lot of documentation with it because the teacher requires it.

Re: Java Program

I gave it a try - what can I say, I was bored!

I added error handling for the input. So, basically:
- if they enter a non-integer as a start or end time it will prompt again.
- if the enter a start time that is later than the end time it will prompt again
- if their input is <0 or >24 then it prompts again

Yeah I know its a boring program, but the teacher doesnt want us doing anything exciting for fear we might learn something. He did this to show those in the class who have never programmed, how to do the "for" loop Thanks for the help. The method I wrote to handle bad numbers looks like this: