CS125: Introduction to Programming Principles
CS125 Spring 2008
Assignment 4
Due: Monday July 14th at 11:59pm
Problem Specifications
The questions are given in pdf format.
Common Assignment Problems
Before emailing the course staff with assignment questions, please refer
to the assignment FAQ.
Starter Files
Download a4.zip before beginning
to code your solutions. It includes "beginner" files for each question
which handles some of the input for you, and contains valuable comments
to help you write your code.
It also contains two driver files to act as a starting point for testing
Questions 1 and 3.
Question three contains the method signatures for the Polynomial class.
You cannot modify these signatures. You cannot add new public methods
either.
Program Input/Output
Be sure your program's output matches what is expected. Some of your
correctness marks will be based on conforming exactly to how the output
should appear.
Program Style and Documentation
Marks will be awarded on this and all future assignments for appropriate
documentation and program style. The markers will, in particular, be looking
at the following:
- Making and using helper methods when performing stepwise refinement
A considerable number of marks on question 1 will be given to
understanding stepwise refinement.
- Making and using constants instead of embedding magic numbers and
strings in your code.
- Appropriate capitalization in your code.
- Using
public and private appropriately.
- Putting pre and post-conditions on your helper methods
- Not adding any new public methods to the provided files.
- Including a program header at the top of each file, which includes
your name, userid, student id number, and lab section.
- Appropriate and meaningful variable names, following conventions
discussed in class.
- Including comments on blocks of code, briefly explaining the
purpose of those lines of code.
- Including comments at the end of any tricky lines of code that
require extra explanation. You should not put a comment after every single
line, though, as this makes the code more difficult to read.
- Appropriate use of white space (including blank lines and indentation),
so that code looks well-organized and is easy to read.
Submitting your assignment:
You will need to submit your assignment electronically. You should submit
often before the deadline, as you can submit as many times as you wish. You can find
the submit page here. Email submissions
will not be accepted should you run into problems.
Required Files:
DrawPicture.java
Lights.java
Polynomial.java