Introduction to Programming (CPSC 124)
—Hobart & William Smith Colleges, Fall 2014
Thursday Lab #1
Home | Syllabus | Calendar | Class Notes | Labs and Projects | General Notes

Due by 2:59 pm on Friday, 09/05/2014)


The goal of this short assignment is to familiarize you with the basics of our campus Linux system, in particular the basics of command-line use of the Linux machines and the conventions we will use for turning in work in this class.


Exercises: Linux

To complete this lab, you'll do some exploring to find out a little more about Linux. You should put your answers to 1-3 in the lab1-writeup.txt file that you started earlier. (Use gedit to edit it.)

  1. Begin with the tutorial document, "Introduction to the Math/CS Linux System", available from our class web page. Work your way through the steps in this document. You should be able to finish the last step where you submit an "assignment". This is the basic mechanism you will use for all your work this semester.
  2. For each of the following, give the full path name for the file or folder mentioned. If shortcuts are possible, list those too.

    1. Your lab1 folder.
    2. The lab1-writeup.txt file where you are writing these answers.
  3. Answer the following questions using the information on the Using Linux at HWS web site:

    1. If you accidentally put a file in the trash, you can restore it. But what if you accidentally delete something from the trash, or use "Delete" instead of "Move to Trash"? Is there anything you can do to get that file back? Explain.

    2. If your computer crashes, why shouldn't you just reboot it? Explain, and list two strategies for fixing problems without rebooting.

  4. Explore Linux and Cinnamon. Quite a lot about the environment is configurable - you might check out what you can configure under Preferences, Preferences->Cinnamon Settings, and System Tools->System Settings on the Applications menu. You might also check out what applications are available, or what other information is available in the Using Linux at HWS pages. Write at least two paragraphs about what you've found/learned.

  5. Paste the following Java program into a new source code file:
    public class Hello {
        public static void main(String[] args) {
            System.out.println("Hi there, " + args[0] + "!");
            System.out.println("How are you today, Mr. " + args[1] + "?");

    Compile this program (using javac), and run it (java). What do you notice about using this at the command line? What changes to the source code are necessary, in order to have it greet you by the last name only, then ask you how you're doing by your first name?

  6. Write a paragraph or two to accompany your other answers, telling me the following:

    • your name, and what you prefer to be called (if different)
    • your major and minor if you've declared them, or what areas you are considering
    • why you are taking this course
    • any computer science or programming courses or experiences you've had
    • whether you think of yourself as a "computer person" - do you feel comfortable using computers, are you often successful at figuring out new things using computers, etc
    • whether you think of yourself as a "math person" - do you feel comfortable working with basic geometry (shapes and coordinates) and simple equations?

Don't forget to follow the steps to hand in your lab (again) when you are done! Also, remember to reboot your computer when you leave the lab (or log out if you are in the Lansing lab).

John H. E. Lasseter