Homework 1 for Computer Science 125

Introduction to Computer Science

Boise State University, Spring 1999


This homework is due by 9pm, Tuesday, 26 January 1999. See the directions below to electronically submit homework.

Warm-up and Practice Problems

These are not be turned in. They are to help you understand the material, and some will appear on exams.

Submitting Programs

Programming exercises are submitted electronically. Before you start an exercise, you should do the following: After you have finished a program and tested it thoroughly, you need to submit the program electronically. To submit a program, you do the following:
  1. Include the honesty pledge at the top of each program:
    /* I, < insert you name here>, pledge that this program is
    my own indepedent work and conforms to the academic
    honor code.
    */
  2. Include a comment with your name, your login, and a short description of what your program does.
  3. Change directories to the program you would like to submit. To check to see that you're in the right place, use the commmand
    pwd
    The directory path returned should end in ``p1'' for Program 1.
  4. Compile your program. For example, to compile Hello.java, you type:
    javac Hello.java
    If there are errors, you will need to edit your program, fix them, and compile again.
  5. To run your program, type:
    java Hello
    (The program should say ``Hello World!'' with the exact spacing given below.)
  6. Type the submit command
    submit stjohn cs125 1
    Since this command gets used for many different courses, you need to specify the instructor and course name before specifying which program number you are submitting. (``stjohn'' is the instructor of the course, ``cs125'' is the course name, and ``1'' stands for Program 1).
    If all goes well, the submit command will say the program has been successfully submitted. If it doesn't, something went wrong. You should get help and submit the program again.

Graded Problems

P1. Program the "Hello World" program described on p 21 of CCJ. Submit this as program 1, using the electronic submission described above.

P2. CCJ: Exercise P1.5, p 38. Submit this as program 2, using the electronic submission described above.