CS 116 Lab 00

Objectives

After completing and reviewing the material covered in this lab, students should be able to:

  • create a project within the Eclipse IDE
  • add Java packages and classes to an Eclipse project
  • write, build and run a simple program using Eclipse
  • initialize a Git version control repository
  • add and commit source code to a Git repository
  • push commits from a local Git repository to BitBucket
  • import a project into Eclipse from a Git repository hosted on BitBucket

First lab notices

Because this is the first lab writeup, and you're likely accustomed to conventions established by other instructors/courses, I wanted to point out a few things:

  1. Lab writeups are not intended to be self-standing — you must be present in lab to receive additional instruction and information from the instructor/TAs for things to make sense.
  2. A 'Grading' section towards the end of each lab writeup will typically indicate how many marks are allocated to the lab and include a grading rubric to be used by your assigned TA.
  3. All work on labs will be submitted via our shared Git repository on BitBucket. This lab is intended to demonstrate the workflow. See the end of this writeup for a summary of how you should start/end each lab session to be sure your work gets pushed to BitBucket correctly.

Project and Package naming

Though we'll remind you of this during the lab session, here are some important details regarding the naming conventions we expect you to adhere to throughout the semester:

  1. The initial project you create in eclipse should simply be named CS116
  2. For each new lab you will be creating a separate Java package — these packages will follow the naming scheme edu.iit.cs.cs116.labXX, where XX is replaced with the current lab number. For this lab, use the package name edu.iit.cs.cs116.lab00 for all classes you create.

    If you fail to name your packages correctly, your TA will likely not be able to locate your work on a given lab, and you may lose points needlessly.

Accessing your BitBucket repository

You should've received an e-mail inviting you to share a repository on BitBucket with the instructor — if you haven't, stop here and talk to him first. You won't be able to complete this lab without the invitation!

In order to access the repository, you'll need to create a free account on BitBucket (if you don't already have one). When you're done with this you should have an account on BitBucket and a repository associated with that account named cs116-spring16-hawkid, where hawkid is your MyIIT username.

When prompted to in the lab, you'll need to enter a URI (Uniform Resource Identifier) for your repository; this will take the form of the following (where hawkid is replaced with your own username, of course):

https://bitbucket.org/michaelee/cs116-spring14-hawkid.git

The reason this URI contains the instructor's username (michaelee) is that the repository is technically owned by him — you and the TAs are the only other people that will have access to it, however.

Where asked for authentication details (e.g., when pushing to or cloning/importing from BitBucket) be sure to use the username and password you chose when signing up for your BitBucket account.

Completing this lab

After working through the steps in lab you should have a single file named "HelloWorld.java" in your edu.iit.cs.cs116.lab00 package. To complete this lab, add another file named "CheckIn.java" to the same package that when run will print out the following:

  1. Your name
  2. Your IIT e-mail address
  3. A joke (really, we can use some humor while grading).

Naturally, this means that the CheckIn class will contain its own main method. Be sure to commit and push your work to BitBucket.

Grading

This lab is worth a total of 10 points. For full marks:

  • your project must be pushed to BitBucket, and your packages and classes must be named per the specifications given above
  • your "CheckIn" class must compile and run correctly and print out the required information

Future lab start/end procedures

For all future lab sessions, we will expect you to do the following at the start of class (without prompting):

  • start Eclipse
  • import your lab repository from BitBucket into Eclipse
  • if a new lab (with ID XX) is in session, add a new package named edu.iit.cs.cs116.labXX to your project

While working on the lab during class, you should commit your work periodically to the local repository. E.g., if we start the class by giving you some template code to use, you might want to commit this before making any additional changes. Commiting work after completing each exercise is a good idea, too.

At the end of the lab session, if you've made any changes/commits to your repository, be sure to push them to BitBucket. If you don't do this you will lose your changes!