CMPS 134 – Spring 2010, HW #0 (Due: Thursday, February 11, 2010)

Homework #0 – Getting Started and “Set Up” (Due: 5pm, Thursday, February 11, 2010)

This assignment consists of activities that are not indicative of the work to be done on “real assignments”, but rather are merely preparatory to what we will be doing throughout the semester.

Upon completion(more or less) of these activities, you are to submit a message to me (not an e-mail message; see Part VI near the end for the details of submitting) indicating your progress. I plan only to record receipt of your message; you will not be assigned a grade.

Of course, if you have difficulties or are unable to adequately complete these activities I am available to assist you as appropriate. I should not be your first line of assistance, however. You should give it your own best effort first, secure other assistance (classmates, friends, Help-Desk, etc.) as appropriate, and then see me if necessary.

Part I – Register yourself on the “Course Web Page”

If you have not yet done so, visit the “course web page” at select(under the heading Student Functions) the hyperlink labeled “Register”, enter your Royal number, click on “Submit Form”, enter the requested data (only the Password is required), and then click on “Submit Form” again. After it responds that you have become authorized, verify itby going back to the course web page and selecting “View Class Roster”. Your name should appear on the list when you click on the “Select” drop-down menu. It is necessary that you register yourself because all assignment work (including the message you are to submit for this activity) is to be submitted electronically to me via the course web page.

Part II – Let me know your background

For this part of the assignment you are to compose a brief explanation of your computing background. In particular, I’m interested in knowing whether or not you have ever programmed and which programming languages you may have used.

Don’t be concerned if you do not know exactly what is meant by “programming”. Our past experience in teaching this course suggests that more than 75% of students who enroll in it have never programmed before and thus are not familiar with any programming languages. So if this is the case with you, take comfort in the fact you will likely be in the majority. CMPS 134 is an introductory course.

Use MicroSoft Word (or some similar tool) to prepare this explanation. It should be a paragraph or two in length, must include your name, and is expected to be properly written (i.e., using proper grammar and coherent sentences, such as could be expected of a capable college student).

Although this explanation could be attached to an email message and sent to me, I do not want you to do that. Instead, this assignment requires that you communicate your explanation to me via the “Submit/Review” link on the course web page adjacent to the link that brought you to this document. This is detailed in Part VI, near the end of this document.

Part III – Installing and testing Java and jGRASP on yourpersonal computer

As a necessary prerequisite to developing programs for this course, you will need to have access to a “programming environment” containing “tools” that will aid you in creating, modifying, and executing programs written in the Java programming language.

If you have a personal computer and intend to use it for work in this course, you should install Java and an IDE (i.e., Integrated Development Environment). Java is the programming language that we will use in the course, and jGRASP is the IDE that I encourage (but do not require) you to use. Both of these are available on the CD included with the course textbook, and they are also freely available online. The most recent version of Java is available at and the most recent version of jGRASP is available at

Since the majority of us use the MicroSoft Windows “platform”, this write-up is geared towards that group. If you happen to use some other platform, you are directed to look for versions of these tools available for it. (If you have questions or run into any difficulty, see me and I will try to direct you to someone who may be able to help you.) Mac users should not have to worry about installing Java, because it comes “pre-installed”on that platform. (So Mac users can skip past Part IIIa and go directly to Part IIIb.)

If you have little or even no experience installing software, this assignment will benefit you in that it will require you to deal with some issues that you may not have encountered before. Although some of the steps are detailed, there are important concepts behind these details that are worth discovering, even though the details remain a nuisance. The details constantly change, but it’s the concepts that persist, and this is a vitally important point to learn about computers and computing.

Part IIIa – Installing Java

Although the textbook’s CD contains versions of Java and jGRASP for installation, this write-up illustrates how to download these tools and install them from their online sources. Either way should be fine for our purposes in this course.

Installing Java basically means downloading an installation program and then executing it, resulting in your machine being able to invoke the “Java Compiler” and the “Java Virtual Machine”. You almost certainly already have the “Java Run-Time Environment”, known as the “jre”, on your computer. The reason for this is that Web browsers use the “jre” to allow them to view and navigate the web. We need more than the “jre” however. We need the Software Development Kit (a.k.a. Java Development Kit), often referred to as “sdk” or “jdk”.

So open a web browser, go to , and follow the directions superimposed on the “screen shots” on the next few pages.

After you select “Run”, the process of installing Java will begin. Read and follow the instructions carefully. I encourage you to accept each of the default settings and options, rather than attempting to customize your installation in some way. Take particular notice of precisely where in your computer’s file system Java will be installed. Most likely it will be at

C:\Program Files\Java\jdk??????

where the ?’s will refer to the exact version number you are installing.

Do not attempt to install Java (or jGRASP or anything for that matter) on any public computer anywhere on campus. Java and jGRASP are already installed in the STT 488 - Plonsky Lab and in some other labs on campus. Attempting to install such software in a public lab may jeopardize the functionality of those systems and be a nuisance to many.

Part IIIb – InstallingjGRASPon your personal computer

After installing Java, you should install jGRASPon your computer. To do this, go to

Select the “Download jGRASP” link in the upper-right corner of the page. I see no reason to complete the survey. I recommend you then select jGRASP 1.8.7_07 to download.

As has already been illustrated with Java, you are to download and then run the file to complete the process of installing jGRASP. Again, I recommend you read and follow the instructions carefully and accept the defaults.

Part IV – Testing Java and jGRASP:

Go back to the links on the course web page pertaining to this assignment and download the provided example program,calledHelloWorld.java. (Before doing so, you may want to create a folder for storing the Java programs you will be working with in this course.)

On the desktop (or using the Start Menu) find the icon for jGRASP and then click it to begin running jGRASP. A window resembling the one shown below should pop up, indicating that jGRASP has been correctly installed.

As you can tell, the interface is very similar to most Windows-based programs. Now, under the “File” menu, select “Open” and choose the file (HelloWorld.java) that you just downloaded from the course web page. This will load the file into jGRASP. The jGrasp windowshould now look like:

The window just opened presents to you a complete (although small) Java program. This program contains instructions telling the computer to print the message “Hello, World.”. Before it can be executed, we need to “compile” it, which means to translate it into a binary form that the computer can “understand” directly. To compile, select the button that looks like a plus sign .

In response, the following message should appear in jGRASP’s bottom window.

If you do not receive such a message, it may mean that the Java compiler (one component of the Java SDK) has not been correctly installed. The Java compiler is itself a program that performs the task of translating “Java Source Code” (i.e., those statements in the file HelloWorld.java) into instructions expressed in a binary form that the computer can then execute directly. A successful compilation results in the creation of a “Java Class” file; in this case, its name should beHelloWorld.class.

Assuming that your compilation has been successful, you can start the execution of the HelloWorld.javaprogram by selection the button that looks like a running humanoid.

Selecting this button should result in a screen that looks like the following. Take special note of the bottom window, which now shows the output resulting from running the program.

If you obtain this result, it is clear that both jGRASP and Java have been installed and you are now ready to begin doing the “real” assignments of this course.

As your first step in programming I ask you to modify the given HelloWorld.java program and have it, in addition to outputting the message “Hello, World.” also output the message “Good-bye, Universe.”. To make the program do this you need to insert an additional statement in the main() method, immediately after (i.e., on the next line, preferably) the System.out.println("Hello, World."); statement that is already there.

Part V– Testing Java and jGRASP in STT 488 -The Plonsky Lab:

Java, jGRASP, and lots of other software is available on the computing machines in room STT 488 (The Department of Computing Sciences Plonsky Lab), which you may use for doing your work in this course. STT 488 is not a “public” computing lab; rather, it is for students currently enrolled in CMPS courses, and soa separate authorization is required to use the machines in this room.

You may think that ---because you own a personal computer and hence you will never need to use this lab--- performing this activity is a waste of time. Well, perhaps not. First, you are here to learn and so having this opportunity to apply concepts in a slightly different environment (with a potentially different set of details) is a worthwhile activity. Secondly, it may happen that your PC becomestemporarily unavailable to you at some time during the semester. If this were to happen,you might have to resort to using the machines in the Plonsky Lab instead. This activity gives you the opportunity to learn and to become prepared for that possibility.

Every student registered for this course has an authorization (i.e., username and password) allowing her/him to make use of the resources in the PlonskyLab. This authorization is a distinct instance of the same User Name and Password you already have as a UofS student. In particular, your initial password is your Royal number (including the capital ‘R’). Our department’s System Administrator, Mr. Bill Gunshannon, manages these authorizations, and if you are unable to log into the computers in the Plonsky Lab, let me know and I will ask him to fix things.

  1. Log onto one of the computers. If you have a portable “USB” or “thumb” drive, insert it into the USB port so that it can be recognized.
  1. Bring up “My Computer” from the “Start Menu” for the purpose of checking for a “mapped network drive”. If a network drive is mounted for you then it will appear as drive “Z:\”, or “Y:\”, or possibly “N:\”. If such a drive appears then check for the presence of any files stored there. There should not be any. Likewise your portable drive should be recognized and will probably be identified as drive “E:\”.
  1. Now, use IE or some other Web browser to load the Course Web Page and download the file HelloWorld.java to your mapped network drive or your thumb drive. You should not save this file on the computer’s local hard drive (drive C:), since the computer is public and all files saved on that drive are available to anyone using that computer.
  1. Start jGRASP, open HelloWorld.java, compile it and run it as you did in Part IV.
  1. When you are finished using the computer in the lab be very sure to log off. You do this either through the “Start” menu or by entering CTRL-ALT-DEL. Note that not properly logging off leaves the machine in a state that could allow the next person using this computer to access your files stored on the network drive and even possibly utilize your authorization in your name to do unsavory things. See the University of Scranton’s Code of Responsible Computing (at and be careful.

Part VI – “Submitting”:

The purpose of this non-assignment is to prepare our computers and ourselves for the work we will be doing. On the course web page (next to the link to this document), there is hyperlink labeled “Submit/Review”. Clicking on ittakes you to a page, presenting a form, similar to the following:

This will be the standard form to be used to submit work on the assignments of this course. The form requires a “Title” and something simple such as “HW #0” is recommended here. The “Message” area allows you to enter a brief narrative, but it has limited functionality. For example, there is no spell checking and in fact you must enter “hard returns” in order to format lines for readability.

For this assignment, compose a brief message indicating the degree of success you’ve had installing and testing the software. Are you at a point where you can compile and run a Java program within jGRASP? If so then you are ready for Assignment 1 when it comes and that’s really all I want and need to know from you at this point.

You are to use the “File” fields with their accompanying “Browse” buttons to “attach” the MS Word file you prepared in Part II. This will be the only file you should attach.

Note that this simple form, although appearing similar to an email message, is functionally different. The title, message, and files you submit are transferred to me and placed in a folder of which I am the owner. These files (and any files I may add to the folder in order to provide feedback to you on your work) are available for you to “review” online at any time. In this sense, reviewing means that you are able to “view” and download but not modify these files. Be assured that these folders containing your submissions and my feedback are stored in a protected way as to be accessible by only me and you (through the authorization you activated when you registered).

Good luck, and I will be looking for your submissions.

R.W.M.

R.W.McCloskeyPage 1 of 12