ulrail.gif

Lab 1: Standard Procedure

  ur-2c.gif urrail.gif
blrail-nonavbar.gif

Home | Resources | Homeworks | Exams
Slides | Labs | Contacts | Submit | TAs

br-2a.gif   br-2c.gif brrail.gif
spacer.gif spacer.gif spacer.gif

Purpose

This lab has several parts that prepare you for future labs and homeworks.  The goals of this lab are:

  • Introduce you to the standard laboratory procedures
  • Explain our use of the UVa home directory service
  • Go through the basics of editing, compiling, and running a Java program using JCreator
  • Run through the process of submitting assignments -- this will be used for homeworks, labs, and quizzes
  • Discuss how to install Java and JCreator or on your home machine

We have created two Java program files that you are to manipulate and then submit as part of this lab. The files are MyName.java and CompileError.java. Their use is discussed later.

If you have any questions, please raise your hand to ask a teaching assistant to help you - this is the purpose of having the lab sections.

Most students will have a basic knowledge of using Windows.  If not, then no problem -- just ask a TA for help.  In an effort to keep this lab text (relatively) short, the details about copying files and such have been left out.  The TAs can help with this.

 

Working in Pairs

Because of the lab scheduling issues for the first week, you are allowed to work in pairs for this assignment but only if there are no free computers.  However, each person must submit the files under his/her own username.

 

Home Directory

When you log into the machine, a home directory login will appear.  Log into your home directory using your UVa ID and the appropriate password.  Your username should be of the format \\ESERVICES\mst3k, where mst3k is your userid. The Server Name should automatically say \\HOME1\mst3k. By default your home directory will be mounted as the J: drive.  If your home directory password does not work, or you have forgotten it, see here.

You can install the home directory service on your home machine as well - see http://www.itc.virginia.edu/desktop/homedir/.

All your submitted files must be copied to your home directory before the due date of the assignment.  If there is a problem with the submission, then only the copy in the home directory will be considered to resolve the issue, and only if it was copied there before the assignment was due.

If your home directory is not working for this lab, you can save the files on the local computer, and then e-mail them to yourself when they are completed -- this will serve as a backup for this lab.

 

Assignment submission

We first want you to become familiar with the Submissions page of the CS 101 website.  We suggest that you do so in a different browser window. You can do so by right-clicking on the preceding link and select "Open in New Window" or "Open Link in New Tab".  The five links on the left side of this page allow you to manage and review your assignment submissions for this course.

  • Passwords

There will be two passwords for CS 101 (unfortunately, we are unable to have only one password this semester).  You are welcome to set them to the same thing -- however, realize that if you change one, the other will not be modified.  And these passwords are separate from any others (such as for e-mail or your home directory).  For both, your username is the same as your official UVa email ID (mst3k, for example).

The first password is so you can log into the machines in Olsson 001.  This password should have been e-mailed to you; if not, then have a TA log you in using the default account.  Of course, if you are reading this, then you probably have already been logged in.  You can change this password by pressing Ctrl-Alt-Del, and selecting "Change Password".  If you forget your password, the TAs can have it reset for you (this is not working the week of this lab, but should be working next week), but there is no way for them to find out what is is.

The second password is so you can submit the files for this course.  This password is set initially to the last 4 digits of your UVa ID number.  By clicking on the Change your CS 101 password link, you can change it to something else.  You will have to enter your email ID, old password, and the new password that you want to use.  For security reasons, you will need to change your password.  If that does not work, or if you forget your password, you can have it reset by clicking on the Reset your CS 101 password.  The reset requires that you enter your email ID and your full UVa ID number (our single use of the full number in the course) -- and no dashes in your UVa ID number.  A random password is then generated and sent to your official UVa email account (e.g., if mst3k is your email ID, then the password is sent to mst3k@virginia.edu).  You can then change the password via the Change your CS 101 password page.

Note that you will also need your home directory password during this lab as well (discussed below).

  • Submissions

The Submit an assignment link will allow you to submit an assignment.  The submission process is discussed below in detail.

  • Regrades

All lab assignments, programming assignments, and lab quizzes will have the grade e-mailed to you.  That e-mail will include the grades for each of the sub-parts of the assignment, and if you did not get full credit, then an explanation why.  Included in the e-mail will be a link to the grading guidelines, which will explain how and why points were awarded.

If you believe that you deserve more points than given, you will need to fill out a regrade request via the Submit a regrade link.  All lab assignments, programming assignments, and lab quizzes must have their regrades submitted via this web page.  All regrades must be submitted within 10 days of when the assignment grade is e-mailed to you.  This 10 day limit is enforced by the regrade system, and the list of assignments that are allowing regrades is listed at the top of the page.  If there is a valid reason why you were unable to submit a regrade during that time, you can speak to the course personnel, but in general, late regrades will not be accepted.  When submitting a regrade, you need to explain why you feel you deserve more points (just saying "I want a higher grade" is not a valid reason).

Exams, which are paper-based, will have a paper-based form to fill out for a regrade. Exam regrades must also be submitted within 10 days of when they are initially returned in class. There will be more on this when the first exam is returned. 

  • Lab extensions

If you are unable to complete the lab during the normal lab session, you can get an extension via the Request a lab extension link.  This link allows you to finish the lab within the next 24 hours on another computer (home computer, school computer, etc.).  There is no penalty if you are not able to finish the lab during lab session.  To get an extension you MUST submit all the files that you have completed so far (even if they don't work!) before you leave lab.  If you do not do this, you will not get credit for the lab.  There are no exceptions to this policy.

  • View course grades

This link will allow you to view all of your course grades throughout the semester.  Once a graded assignment is returned, it will be e-mailed to you, and will then appear on this page.  Note that the grades do not appear on this page before they are e-mailed to you.  Currently, there are no grades to be viewed, however.

 

Introduction to Java and JCreator

Put a copy of MyName.java in your Home Directory folder by right clicking on the link and select "Save Link As" (or "Save Target As").  Note that if you just click on the file, although it will load up into JCreator, it may not compile correctly.

Next load the file into JCreator. You can do so by either double clicking on the copy of MyName.java in your Home Directory folder, or by starting up JCreator and then select the Open entry of the File menu (i.e., select File->Open) and find the MyName.java file.  While this lab does not discuss the various parts of the MyName.java program mean, please examine the two lines that start with System.out.println. Each of them prints out a line of text.

Press the compile button at the top of the window, which is shown highlighted in the image on the right. This will start the compilation of the Java program.  All Java programs must be compiled before they are run.  Basically, computers do not understand Java code.  The compiler will translate the Java code that you write into a form that the computer can understand.  That translated code is then run when you execute the program (below).

 

 

The bottom of the screen will show the status of the compilation, as seen in the next image.



 

If there were any errors, they would be reported there.  "Process completed" means it compiled without any errors.

Note that sometimes JCreator will hang while trying to compile a program.  If so, the lightning bolt button (shown below) will fix the situation.  Note that this button only lights up when JCreator is compiling a program, and it will be grayed out otherwise.

Next, you can execute the program.  To do this, press the execute button, which is shown highlighted below.

This will pop up a black window, as shown below.  This window shows the output produced by the execution of the program.  For this program, it shows the two lines printed via the two System.out.println lines in the program code.

Now edit the file in JCreator, and change the name and email address in the header (the first 3 lines, which are green-colored in JCreator, are the header).  Next, change the second System.out.println line to your own name.  Then save your file (File->Save), compile it, and run it.  If you are working in pairs, put both of your names in the header, and in the System.out.println statement.

Note that all of the ITC labs in the University have Java and JCreator installed, and you are welcome to do your homeworks on those computers (especially if you don't have your own computer).  However, they have a slightly older version of JCreator -- although it works the same, the buttons will look a little different.

Submitting the file

We want you to submit the file, so click on the Submit an assignment link.  Again, it will probably be easier to open up the page in a new window (right-click on the link and select "Open in New Window"). 

The submission form will often have a few survey questions to fill out.  These questions are there so that we know how we are doing, and will ask things such as how useful you felt the assignment was, how long it took, etc.  For most labs, there will only be one question, "How well did you understand the concepts gone over in this assignment".  Select the appropriate answer.  There is also a comments box, where you can state any remarks that you have about the assignment.  We are interested in this feedback, and will read each of the comments and try to use them to improve the next course offering.  You will notice that some questions are required (such as the "how well did you understand this"), while others are optional (the "general comments" question), and are indicated as such.  Note that only one set of answers is recorded per person per assignment.  Thus, you don't need to give a different set with each file you upload.  If you do give a new set of answers, your old set will be overwritten.

The process to submit a file is as follows. Enter your e-mail ID and password, select the assignment (Lab 1), and click on "Browse..." to select the file to submit.  This will pop up a window that will allow you to find the file you want to submit (MyName.java). Fill out the survey, then click on the "Upload" button at the bottom.  If there is a problem with the submission, it will state so.  Otherwise, it will tell you that your submission was successful.

If you are working in pairs, each person must separately submit the file.

Checking the submission and its compilation status

You can check which files have been submitted. To do so, make sure the User ID and Password fields are filled out, and select the correct assignment (Lab 1) from the assignment selection box.  Then click on "List".  This will list the file(s) submitted for this assignment.  Note that the assignment is currently incomplete, shown by the blinking red "file not found", as only one of the two required files has been submitted so far (the second will be submitted below).  The listing will also show the code for the file(s) that have been submitted.  If you do not submit all the files, you will not receive full credit for the assignment.  We'll submit the second file for this lab below.

Next, make sure the User ID and Password fields are filled out, and select the correct assignment (Lab 1) from the Assignment selection box.  Then click on "Compile".  This will compile the file(s) submitted.  Doing this compilation is important, as it will check to see if there are any errors.  If your submission does not compile, you will get lots of points off for the assignment.  Thus, it is in your interest to make sure that all submitted files successfully compile. Because only one of the two files has been submitted, this compile check will also state that one file is missing.

The second file

  • Put a copy of CompileError.java in your Home Directory folder (right click and select "Save As").  Load it up into JCreator, and compile it. It will show a compile error when you do so, as shown below.  Do not fix this bug yet!


     
  • The display will indicate that a semicolon is missing (i.e. Java expected it to be there) from the CompileError.java, line 8.  If you look at the file, there is no semicolon at the end of line 7.  Do not fix this bug yet!
     
  • Note that the semicolon is missing from the end of line 7, but Java does not realize this until it reaches the next line.  Thus, although the problem is on line 7, Java will specify line 8 as the problem line.
     
  • Submit the file via the Submit an assignment link (for both people if working in pairs) -- the program should still have the error in it.  There is no penalty for submitting a file multiple times, and only the final submission is considered.  Thus, if an earlier submission has errors (as this one does), as long as those errors are corrected before the assignment is due, there is no penalty.
     
  • List the assignment.  Note that both the required files have now been submitted, and thus will be shown.
     
  • Next, compile the assignment.  Note the error messages for the CompileError.java file, indicating that the file did not compile.
     
  • Back in JCreator, add in the semicolon at the end of line 7.  Change the headers to your name and e-mail address, and submit the file (for both people if working in pairs).
     
  • Now list and compile the submitted version -- it should show that both of the files compile successfully.

 

Java and JCreator Installation

Students often find it convenient to install Java and JCreator on your their machines -- they do not have to go to UVa public lab. The installation is not required as all UVa public machines have both tools installed.  If you choose to install the software, please realize that we offer advice, but we are limited in how much support we can provide for this activity.  If you have a laptop, and run into installation difficulties, you can bring your laptop to office hours and one of the TAs or instructors can help you install the software.

If you have a Macintosh computer, you can find detailed installation instructions here.

For Windows, we provide brief instructions below.  Both of the programs listed here are free to download and install.

  • First, download Java from here.  You want to follow the "Download JDK 5.0 Update 6" link.  Install this software.
     
  • Next, you can download JCreator here.  Follow the "Download" link to download JCreator 3.50 LE (the professional version costs $70 or so).  Then install JCreator.

For the tools to install correctly you need to install Java BEFORE you install JCreator.

You can install the home directory service on your home machine as well - see http://www.itc.virginia.edu/desktop/homedir/

 

Finishing Up

This completes the lab.  Be sure to log out!  No need to restart the computer, though.

spacer.gif
spacer.gif footer-middle.gif spacer.gif