The purpose of this assignment is to help you get familiar with the UNIX environment and to learn how to compile and run Java applications and applets. You should use your course accounts on the instructional Unix workstations for the assignment. Check the home page for CS 367-5 for information about Unix Orientation Sessions and about activating your account. You should activate your account and create a directory for this assignment. (mkdir assign1 will create a directory called assign1, and cd assign1 will put you in this directory.)
After creating the file, you should compile the code by typing:
If all goes well, this will produce a file called HelloWorld.class. To run the program, type:
To create a file called helloworld.out that contains the output of the program, type java HelloWorld > helloworld.out. Turn in the helloworld.out file using the Assingment Handin instructions on the 367-5 assignment web page.
Click to see a simple Java applet. It has a similar function to the "HelloWorld" application, but it's designed to run in the context of a web page. For now, don't worry about how it works. Create a file called HelloWeb.java that contains exactly the code for the applet. Compile the HelloWeb class as you compiled the HelloWorld class; that is type javac HelloWeb.java.
To run your HelloWeb applet, you'll need to create an html file for a simple Web page, such as this html file. Call this file HelloWeb.html. After creating the file, type netscape & and after the netscape window has popped up, type in the box marked "Location:":
where /wherever is the full pathname of the directory where your html file is stored. You can get this pathname by typing the Unix command pwd in the directory that contains the html file.
Turn in a printout of the page you see when you view the html file in Netscape.
CORRECTION: turn in a description of where the message appears on the web page.
What happens if you give a negative number, such as -1, to your Fibonacci program? Turn in a brief explanation of how you would change the code to fix this problem.
Summary of what to turn in:
1. your helloworld.out file from exercise #1.
2. your fibonacci.out file from exercise #3.
1. a printout of the page created by your HelloWeb applet in exercise 2.
2. an explanation of what happens when you give the Fibonacci program a
negative number, and how you would modify the program to fix this problem.