This page aims to address many Frequently Asked Questions (FAQs) by CSE 1020 students. If, after reading this, you still have questions, meet with your instructor or TA, or post a message on the online forum.
Before starting to code a solution to an eCheck task, you might want to follow these guidelines:
See page 70 in the textbook.
To ensure that your program is efficient, eCheck will not accept programs with too many terminated statements (TS). If your program is correct but too long, here are some tips:
See page 108 in the textbook.
Sometimes, eCheck expects a space when you have a tab (or visa versa). But eCheck communicates this using ASCII codes rather than “space” or “tab”. See page 455 in the textbook for an ASCII code chart.
See pages 168 and 201-202 in the textbook.
Input files ending with .txt are text files. But (in the textbook) files ending with .dat contain a serialized object. A serialized object is an object whose state (i.e., attributes) has been written to a file. To read-in such objects, see pages 351-352 for details.
Here are some common exceptions and their meanings:
If the symbol is a class name, then you forgot to import it. If the symbol is a variable name, then you forgot to define it (or mistyped its name). If the symbol is a method name, then the name is incorrect, or the type or number of parameters is wrong.
You forgot a semicolon or parenthesis.
Your file name (excluding the .java extension) should be the same as your class name. Remember that Java is case sensitive (e.g., myClass is different from MyClass) and that class names should start with an uppercase letter.
You are calling a valid method, but are trying to pass incorrect parameters to it.
You forgot a bracket at the end of your code.
Every exception has an entry in the API. Reading the description will often explain why the exception was thrown.
Use print statements to output the value of variables during the execution of your program. This can help determine if intermediate calculations (e.g., inside loops) are correct.
To determine whether or not an if-branch is taken, insert a print statement as the first line in the code block.
You can force your program to terminate by pressing Ctrl+C. This ability is helpful when your program becomes unresponsive or has an infinite loop.