CS 307Assignment 1A, Communications check, Introduction to Software Tools, Java Expressions and Syntax

Programming Assignment 1A: Individual Assignment. You must complete this assignment on your own. You may not discuss their work with anyone except the instructor and other members of the instructional staff (TA, section leader, or lab proctor). You may not acquire from any source (e.g., another student or an internet site) a partial or complete solution to a problem or project that has been assigned. You may not show another student your solution to an assignment. You may not have another person (current student, former student, tutor, friend, anyone) “walk you through” how to solve an assignment. Review the class policy on collaboration from the syllabus.


Description: The purposes of this assignment are:

  1. to learn the assignment guidelines and what is expected of the student when creating programs CS307.
  2. to learn to use the required software tools for the course
  3. to review the basics of the Java language including syntax, variables, and expressions
  4. to create and implement non trivial algorithms
  5. to learn to create test cases for programs you write

Provided File: ShortCodeExamples.java contains a series of code snippets. You will predict the output of each snippet and then compile and run the code.


To Do:

  1. Go to https://udb.cs.utexas.edu/amut/acut/ to request a CS lab account. You must remember the account name and password you choose. They will not be emailed to you. Unfortunately you do not get a confirmation email when the account is activated. You simply have to try logging in starting a day after you request the account. try logging into you turnin directory to see if the account is active. You must have this account to turn in your files, even if you do not plan on working in the lab.
  2. For more information on CS department accounts please see http://www.cs.utexas.edu/facilities/faq/accounts/ and http://www.cs.utexas.edu/facilities/policies/utcs/.
  3. If you forget your password and need to reset it visit this page: https://udb.cs.utexas.edu/passwd/
  4. Sign up for the class listserv. There is a class listserv to facilitate communication in the class. Subscribe to the listserv by sending an email to

    See this web page to log onto the UT lists system: www.utexas.edu/its/mailinglists/answers/subscriber_logon.php

    go to this web page and follow the instructions to subscribe to the listserv: www.utexas.edu/its/mailinglists/answers/subscribing.php

    The name of the list is cs307-scott@utlists.utexas.edu and the subject is CS307 class mailing list.

    I strongly recommend you set up a filter in whatever email program you use to direct messages from the listserv to a separate folder as instead of your normal inbox.

  5. Determine which IDE (interactive development environment. A software tool that helps you write software.) you want to use for CS307. I strongly recommend using Eclipse. Eclipse is available in the lab and can be downloaded for use on a personal computer.You are free to use whatever enviroment you like(JCreator, Bluejay, DrJava, Emacs, VI, etc.) but I recommend using Eclipse. If you use Eclipse see the Eclipse help page on how to enable assertions in Eclipse and set the compliance level to Java 6.0.
  6. Download ShortCodeExamples.java from the class website.

    There are 30 short snippets of code in this program. The program does not compile right now due to syntax errors.

    For each code snippet:

  7. For code that gives a compile or runtime error, simply comment out the entire snippet and run the rest of the program; do not attempt to correct the code. 
  8. Here is an example of a code snippet, expected and actual answer.

    int x = 5;
    x = 2 + x + x;
    System.out.println(x);

    /* expected answer: 12
       actual answer: 12
       explanation. The variable x is assigned 5. The expression 2 + x + x is evaluated.
       x holds the value 5 so after substitution the expression is 2 + 5 + 5
       which evaluates to 12. 12 is assigned to the variable x.
    */
  9. Fill in the header for ShortCodeExamples.java. Replace <NAME> with your name. Note, you are stating, on your honor, that you did the assignment on your own, as required.

  10. Turn in your ShortCodeExamples.java.java program using the turnin program. Turn in your file to your cs307 folder!


Checklist: Did You:

  1. review the general assignment requirements?
  2. work on the assignment individually?
  3. fill in the header in your file ShortCodeExamples.java?
  4. include your comments about each of the 30 snippets regarding the expected output and the actual output at the top of the program?
  5. turn in your Java source code in a file named ShortCodeExamples.java to the proper account in the Microlab via the turnin program before 11 pm, Thursday, September 3?

Back to the cs307 homepage.