Homework 1
DUE: Sun 4/3, 11 pm (no late turn-in)
Collaboration policy: Collaboration is strongly ENCOURAGED, although
of course, you should still submit your own solutions. Questions
on exams and quizzes are frequently taken directly from homeworks.
Turn-in: Compose your homework on a simple text editor such as
emacs or Notebook or Wordpad, and save it as a text file ("text-only format")
with the extension .txt
Submit your work electronically to the hw1 folder on the
cs secure server.
Remember to include the
header template.
This homework requires that you carefully read the course
coding standards
and the course general policies
before answering the questions.
A number of references in the coding standards may not make much sense to you yet,
but the basic rules are very clear.
-
List two styles of opening and closing braces.
Which style will we be using in this class>
-
What are magic numbers? Why are they frowned upon?
-
What is the maximum recommended number of lines of code in a
function?
Eplain the reasoning behind this limit.
-
Explain both the rules and the conventions involved in
naming identifiers.
-
Describe the preferred use of white space, e.g. in writing an expression
using multiple binary operators. (First, you must know what a binary
operator is!)
-
Describe two styles of placing local variable declarations in a
function.
Which of these two will be using in this class?
-
Describe two specific instances in which the class coding style differs
from the text's.
Can you think of a reason why we chose to differ from the text?
-
Describe in your own words the policy regarding collaboration in this course.
-
What do you need to do if you believe an error has been made in grading one of your assignments?
-
List all the sources of material that may be covered in the exams.