COS 126

Assignment 0
Programming Assignment

Due: 11:59pm

The purpose of this assignment is to familiarize you with the mechanics of preparing and submitting assignment solutions. Your goal this week is to learn to use JEdit for editing program, javac for compiling them, java for executing them, and Whiteboard for submitting them.

Hello, World.  The purpose of this step is to setup your computer for developing Java programs.

Programming.  Your job is to write two short programs. We'll assume that you've already created, compiled, and executed HelloWorld.java by following the instructions in the previous part of the assignment. You may use a for loop or if-else statement if you like, but both programs can be written with only material in Sections 2.1 and 2.2.

  1. Write a program Average.java that generates and prints five random values between 0.0 and 1.0, and then prints their average value. Use Math.random to generate numbers betwen 0.0 and 1.0.

  2. Write a program Order.java that reads in three integer command line parameters x, y, and z and prints "true" if x ≤ y ≤ z and prints "false" otherwise.

Submitting the programs.  Once you have Uniform.java and Order.java working, submit them via the Web. To do this, launch your favorite browser and go to the COS 126 web page:

http://www.princeton.edu/~cs126
choose Assignment Submission, and follow the instructions provided. Be sure to hit the Run Script button to check your program against our compiler. It should compile without errors or warnings; if not, fix the problem and resubmit it. To submit a file, you must be registered for the course and know your arizona login name and password. You will receive an automated email receipt confirming your submission.

Browsing the course website.  The final part of the assignment is to browse the COS 126 Web pages. The address is:

http://www.princeton.edu/~cs126
Cruise around the COS 126 Web site; it is essential that you understand what's where and how to get to it. Be sure to fill out the online questionnaire. Also make sure you find the "Assignment 0 Checklist" page, and also be sure to read the COS 126 Collaboration Policy.