
CSC 1760 Introduction to Programming
Lesson 3: Your First Program
Due Date: 1/12/2009
1. Textbook: Introduction to Java Programming, Brief Version, Seventh Edition,
Author: Y. Daniel Liang, 2009, Prentice Hall
a. Sections1.8, 1.9
2. Overview
Using Eclipse, you will enter, compile, and run your first Java program.
3. Tasks
a. Using Eclipse, enter, compile, and run the following program. Save the
program in file named FirstProgram.java.
/****************************************
*
* Student Name: Your name goes here
* Date Due: Date this program is due
* Date Submitted: Date you submitted the program
* Program Name: FirstProgram
* Program Description: Displays โMy first java program.โ to screen.
*
****************************************/
public class FirstProgram {
public static void main(string[] args) {
System.out.println(โMy first java program.โ);
}
}
b. Modify FirstProgram to display โI changed the display.โ Compile and run
the program.
c. Enter, compile and run a program named MyName.java. The program
will display your first and last name on the same line.
d. Enter, compile, and run a program named MyInfo.java. The program will
display your first and last name on the first line and your birthday as MM/
DD/YYYY on the second line.
e. Enter, compile, and run a program named MyName2.java. The program
will display your first and last name using a message dialog box.
f. Enter, compile, and run a program named MyInfo2.java. The program
will display your first and last name in one dialog message box, and your
birthday as MM/DD/YYYY in a second dialog message box.
4. Assignment due:
a. FirstProgram.java
b. MyName.java
c. MyInfo.java