CS 1043 Lab 1 Fall 2000
Wainwright
Purpose: To become familiar with fundamental Unix commands, the Pico Editor and the compiling and execution of a simple java program in the Unix environment.
Students will also learn how to build a script file, and print the script file to the printer.
2. Open a window to login to Euler (Unix system):
then change directory to lab1 as follows: cd lab1
/home/cs1043/java2-textbook
and example java programs from your instructor are located on Euler at:
/home/cs1043/java2-examples
directory and rename it as lab1.java as follows:
cp /home/cs1043/java2-examples/Coins4Lab1.java lab1.java
cp /home/cs1043/java2-examples/ConsoleReader.java ConsoleReader.java
cp /home/cs1043/java2-examples/ConsoleReader.class ConsoleReader.class
Use Pico to edit lab1.java until you get it to compile. Note I have placed several syntax and logic errors in this program.
ADD A COMMENT IN YOUR PROGRAM THAT STATES YOUR NAME AND ALSO THAT THIS PROGRAM IS FOR LAB1. Remember the compile and execute commands are:
javac lab1.java
java lab1
of dollar coins, and all necessary code to accomplish this.
8. Create a script file and print the script file as follows:
script script.lab1
cat lab1.java
javac lab1.java
java lab1
... in here use 2 pennies, 3 nickels, 4 dimes, 5 quarters,
6 half dollars, and 7 dollars.
exit
9. Print the file, script.lab1, and turn it in to your LAB Instructor.
file - exit. This will take you back to the Windows NT System.
12. For your convenience, I have included a copy of the file, Coins4Lab1.java
on the reverse side of this page. Try to locate the errors before you go
to lab. It will save you some time.