Expand All
Collapse All
- What’s the Project link?
-
It’s a ZIP file that contains an IntelliJ project that you can use to develop your program.
It also contains supplemental data files (such as WAV files), which you will use on the assignment.
Click Project
in the menu at the top of each assignment specification (or FAQ) to download
the ZIP file; then, uncompress the ZIP file to create the IntelliJ project.
- Must I adhere to the course rules for formatting and commenting my code?
-
The autograder (and IntelliJ) provide style feedback to help you become a
better programmer.
You should follow these guidelines. If you have a question, ask in Ed.
- Can I use Java constructs (such as loops and conditionals) before they
are introduced in the course?
- No. In general, please do not use any Java features until we have
introduced them in the course.
The autograder will typically flag such submissions.
- What should my program do if the user specifies an invalid input?
-
In general, professional programmers must write code to carefully check and validate
any user input.
In this course, however, you may assume that any user inputs are in the specified format.
For example, you may assume that there are exactly
four command-line arguments to
Greeting
.
-
I don’t understand all of the jargon in HelloWorld.java.
Should I continue with the course?
-
Don’t worry. Java needs a lot of boilerplate code to get started.
You’ll learn the meaning of
public
, static
,
void
, class
, and main
during this course.
-
I get the error
javac-introcs: file not found: HelloWorld.java
when
I type the command javac-introcs HelloWorld.java
. What did I do wrong?
-
Be sure that your file
HelloWorld.java
in the current directory.
-
I get the error
Could not find or load main class HelloWorld.java
when
I type the command java-introcs HelloWorld.java
. What did I do wrong?
-
When compiling with
javac-introcs
, you use the filename with the .java
extension
(e.g., HelloWorld.java
).
When executing with java-introcs
, you use the class name, which has no
.java
extension (e.g., HelloWorld
).
- How do I specify a greeting that is more than one word, such as "Nǐ hǎo"?
-
When specifying the command-line argument, enclose the greeting in double quotation marks.
Your system will interpret it as a single command-line argument.
- How do I enter characters from other alphabets, such as "Nǐ hǎo"?
-
The easiest way is to cut-and-paste them from an existing source, such as a webpage.
- Must I format the output exactly as in the assignment specification?
-
Yes. Be sure to use the same format, punctuation, and whitespace.
- Can I use string concatenation even though that's not introduced until Section 2.1?
-
If you've peeked ahead, that's fine. If not, use several
System.out.print()
statements.
-
When I compile the program, I get the error
error: cannot find symbol StdPicture.read()
.
How can I fix this?
-
This means that Java cannot find our
StdPicture
library. Be sure to
use the command javac-introcs
when compiling from the command line to
tell Java where to find the library.
-
When I execute the program, I get the error
java.lang.NoClassDefFoundError: StdPicture
.
How can I fix this?
-
This means that Java cannot find our
StdPicture
library. Be sure to
use the command java-introcs
when executing from the command line to
tell Java where to find the library.
-
How can I save my handwriting as an image?
-
There are tools for every platform; for example,
GIMP for Windows, Mac and Linux; the built-in Notes app for iPhone/iPad;
and Pocket Paint for Android.