#Please help with database
9 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @covert arrow! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
I keep getting the error of insert new bracket for block, can someone help me please
(trying to get extra credit)
just @ me for any questions you may have
anyone?
Multiple things are wrong with this code:
- Variables are defined but never used
- Variables are used but never defined
- Exceptions are not caught and methods are not declared to throw them.
- Method names are meaningless. You try to explain what the method does in each Comment why not give the method an appropriate name
- In some switch's you define a single case multiple times,
breakis missing - At some point you try to compare a
Stringusing!=you should use equals instead - You are creating multiple readers reading from
System.inas soon as one of them is closed the other ones will throw an Exception since the underlying stream will be closed as well. Use a single scanner /BufferedReaderand pass it throughout the methods or create a separate method to prompt the user for input as well as return said input. - You are reading a file over and over again. Store the contents of the file once (if it is not too large) and use the data structure you stored it in (could be a List or an Array for example) to get information instead of relying on IO operations
- Some method like
Integer.parseIntare called without storing the input therefor making them useless. - Remove duplicate code in the methods and create methods for it although if you follow the advice listed above this should resolve itself to some extend
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.