![]() |
Could someone please tell me why my assignment didn't work.
Hi all. I'm taking my first course in Java and am terrible at it. I failed the last assignment we did and I was wondering if someone could tell me how to fix it so I don't run into the same problems on the next lab. We were instructed to create a working tip calculator. Thank you so much for your help in advance!
Code:
import java.awt.*; |
Re: Could someone please tell me why my assignment didn't work.
Hi.
Your code doesn't compile - there are basic syntax errors that show that this code was never tested. Perhaps you should consider developing in smaller increments, so you can test sections of your code as you go along. A handy tip is to always use brackets {} with if and else statements, in fact, always group related bits of code with these brackets, that way you will never run into situations where you are not sure where a piece of code belongs. If you can fix the syntax errors, like the ; after actionPerformed(ActionEvent e) - you might get the code to compile. Debugging is an important skill, and the only way of learning it is to work through code and find errors, one at a time. What IDE / Editor are you using? |
| All times are GMT +5.5. The time now is 22:09. |