This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Party Program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Party Program" Watch "Party Program" New topic
Author

Party Program

Marving Guildon
Greenhorn

Joined: Sep 17, 2003
Posts: 9
This is what I have so far to completed the following assigment:
The program should include a menu of options using a switch statement, a for statement, three or more methods, an array, a loop, an if statement and instance variable and methods.
Design the program to call methods kept in the PartyXXX file form the main method. One method could tell something about the party such as where it's located, what time it will be and what the party goers need to bring. Another could calculate the cost for supplies, food, drinks, etc.
I got the following errors:

Here is my PartyXXX code:


The main program is here:

[ October 06, 2003: Message edited by: Marving Guildon ]
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8708
    
    6

Originally posted by Marving Guildon:

Please help to debuging the program:
[/CODE]

First I would get something basic to work, like printing out a menu or reading in data and taking some action. Then I would add functionality one piece at at time so if something went wrong I could easily resolve the problem. If I ran into something that did not make sense, I would have an easily isolated piece of code I could separate out and test in it's own class. I'd get that part to work and then integrate it back into the main program. Once I get the requirements fulfilled I would worry about what kind of loops I'm using and other window dressing. This called "Iterative Development" and it is a basic programming skill. As with all skills it requires practice to learn well.
Throwing a bunch of code together and hoping someone else will debug it is not a basic programming skill.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Marving Guildon
Greenhorn

Joined: Sep 17, 2003
Posts: 9
Joe,
Thanks for taking the time and review my program. I tried each code individually and they work, but when I put it together I got the error messages. So, I already used the programming technique that you referred. Any way, if you don't know how to fix it, probably somebody with experience in programming will help.
[ October 06, 2003: Message edited by: Marving Guildon ]
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8708
    
    6

Originally posted by Marving Guildon:
Any way, if you don't know how to fix it, probably somebody with experience in programming will help.
[ October 06, 2003: Message edited by: Marving Guildon ]

Maybe if you could have told me what your errors were or asked a specific question I would have helped you out. Insulting this Sun Certified Java Developer who is taking a break from maintiaining a 2000+ class enterprise application is no way to get help. Speak with your instructor. That's what they are there for.
Marving Guildon
Greenhorn

Joined: Sep 17, 2003
Posts: 9
Joe,
That's an excellent idea, I will ask the instructor, thanks. You are really smart.
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
OK gentlemen, lets retire to our individual corners and come out smiling next time.
Marving, the reason Joe came across that way was because all you did was post your code and ask for help debugging it. Can you give us some info as to where it is breaking down or what error messages you are getting? People often come in here and just throw some code up lookiing for someone else to do their homework or solve a problem before they put in any work themselves. Let us know what the problems are and there are any number of people that will be willing to help you out - even Joe


Dave
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
OK, so I'm slow. I see you put up your errors in your orginal post. just a quick note, if you edit your original post a lot of people will miss that because they are looking for new stuff to be added at the bottoms of the threads.
Your first error is because you don't have a closing brace on the method above the wine method.
At the end of your wine method you have a line that says:
}/* end of output method */
I dont see an 'output' method and this brace will actually be closing the 'information' method that you didn't close before the wine method. If you add the closing brace to the information method then the lines below this brace will give you an error because they will be outside of the wine method.
Hope thats a start for you
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8708
    
    6

Originally posted by Dave Vick:
Let us know what the problems are and there are any number of people that will be willing to help you out - even Joe

This guy appears to be a
plagarist in the making. Handle with care.
Marving Guildon
Greenhorn

Joined: Sep 17, 2003
Posts: 9
Joe,
I�m doing my work, I just don�t know and I have to ask, it is part of the learning process. I�m sorry if I insulted your in a previous posting. Let�s get something done and don�t sweat the small stuff.
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
Calm down guys!!
This is a lot of code man, have you actually tried for a few moments to figure out what the errors are? you wrote that code (didn't you?), you should know what is going on...
1o)
public void wine
if this is a method, it should be:
public void wine()
2o)

I don't know whether the indentation is playing tricks here, but again you have a method declaration with no "()". Inside (it looks like), you're having another method...
hope this little help helps


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Party Program
 
Similar Threads
Halloween Party
Need help..Please! How to keep a running total...
Need advice - How to add items and keep a running total.
Unsolved Programming Problem. Need Help.
Population and Growth Rate Problem