Hi cha wan,
Welcome to CodeRanch!
Before approaching the problem, I would suggest few things:
1) Please
UseCodeTags. You can still edit the original post with it. Also, please post the
working code. Working as in code which user can directly copy-paste, compile and debug on their machines. This will help the people who are looking into your issue. Currently, your code doesn't even have closing braces (and I doubt if this is complete code or not).
2) Please
TellTheDetails. You said that
cha wan wrote:i have problem to continue .....
What does this mean? Is it that there is compilation error? or runtime exception? or some logical error?
3) Please bear in mind that this is
NotACodeMill. It is absolutely fine to ask
help(not ready-made code) on assignments etc., but before that, we would appreciate if you also let us know your line of thinking, and what have you done till yet, and what
exactly are you finding difficult/confusing.
Next to these, I found some serious flaws in the code you have posted. If you are not aware of object oriented concepts, and/or programming in general, then firstly I would suggest to go through a descent book. Also, if you are not a habitual programmer (in terms of logic), then take a paper and pencil, and make sure you've understood/written down every step of logic before even starting of coding.
I don't at all meant to be harsh, and don't worry, these things happen to the first time programmer. But more time you put in the basics now (algorithm, oo concepts, debugging on paper etc.), less problems it will create in the future.
I hope this helps.