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:
- to learn the assignment guidelines and what is
expected of the student when creating programs CS307.
- to learn to use the required software tools for the course
- to review the basics of the Java language including syntax, variables,
and expressions
- to create and implement non trivial algorithms
- 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:
- 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.
- 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/.
- If you forget your password and need to reset it visit this page:
https://udb.cs.utexas.edu/passwd/
- 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.
- 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.
- 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:
- Record what you expect the output to be. Do this before you run the
program.
- Run the program and record what the output actually was.
- Provide a brief explanation the actual output. If there is a
difference between your expected answer and the actual answer that is
okay! Include in your explanation what you didn't understand about the
code. If a snippet would result in a syntax or compile error then the
expected result is "syntax error" or "compile error". If the code causes
a syntax or runtime error explain why the error occurred. You do not
have to explain how to correct the error.
- Place all of your answers to expected output, actual output and
explanation in one big comment at the top of ShortCodeExamples.java. Do
not repeat the short code examples themselves in the comment. Leave them
below the comment.
-
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.
- 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.
*/
-
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.
-
Turn in your ShortCodeExamples.java.java program using the
turnin program. Turn in your file to your
cs307 folder!
-
Realize that your turnin
account may have multiple folders (or directories) if you are registered for
more than one computer science class. (For example CS313k). Ensure you turn
your assignment in to your CS307 folder. We don't have access to your other
folders so it will cost you 2 slip days if we have to take the time to
straighten out the mistake.
-
Ensure you are turning in the version of
ShortCodeExamples.java that has your answers. You may have more than one
version of the file on your system. If you turn in the wrong one you will
lose slip days and / or get a 0 on the assignment.
-
Ensure you file is named ShortCodeExamples.java.
Checklist: Did You:
- review the general assignment requirements?
- work on the assignment individually?
- fill in the header in your file ShortCodeExamples.java?
- include your comments about each of the 30 snippets regarding the expected
output and the actual output at the top of the program?
- 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.