CS 304 Object-Oriented Programming
in C++
Summer 2006
Classroom: CH 430, Fridays from
11:20am-12:44pm
2) Class Notes
3) Assignments
Assignment 4: (due final exam day, before
the exam begins):
Q1)
(8 points) Do exercise 13.13. Limit yourself to TWO 2D and TWO 3D shapes. Note that it requires you to do exercise
12.7 (of which you have to hand in a hardcopy solution).
Q2)
(7 points) Do exercise 14.6. Name the two programs Q2a.cpp and Q2b.cpp. Also,
explain your observations in a hardcopy solution write-up.
(For
your practice only – you don’t have to hand it in) Try exercise
15.15 on class Point.
Assignment
3: (due 14th July, 2006)
Required Reading: You should
have a basic knowledge of UML class diagrams, as well as concepts of
inheritance and aggregation and how to model them using UML. All the UML topics
discussed in the following link will form a component of your final exam (except
“Dependency” and “Interfaces”): http://www.objectmentor.com/resources/articles/umlClassDiagrams.pdf
You are free to use any other UML guides
available on the internet. The Rational Rose UML modeling software is available
in the CIS undergraduate lab for hands on UML design practice. For home use,
you can download the free BOUML toolbox here: http://bouml.free.fr/
Q1)
(7 points) Do exercise 9.12 (Enhancing Class Rectangle). Note that it
requires that you do 9.11 first. Hand in one solution only (9.11 and 9.12
combined). Provide user prompts for rectangle parameter inputs.
For the next two problems, hand in a hardcopy solution only.
Q2) (5 points) Do exercise 12.3. Also give
two original examples (one for inheritance and one for aggregation, using UML
class diagrams) where inheritance/aggregation will be more appropriate.
Q3) (3 points) Do exercise 12.6.
(for your practice only – you don’t have to hand
it in). Try exercise 11.13 on complex numbers.
Assignment
2: (due 30th June, 2006)
Q1) (3 points) Do exercise 8.36 (the strtok
problem).
Q2)
(7 points) Do exercise 8.41 (Text Analysis - part a
only).
(bonus:
3 points) Do exercise 8.46, the Morse Code problem.
(For practice only: You don’t need hand these in)
Try to do exercises 8.21, 8.22, 8.23 and 8.29. Tackling these will
exercise and strengthen your pointers and pointer manipulation concepts.
Assignment
1: (due 16th June, 2006)
Q1)
(5 points) Do exercise 6.38 (pg. 320) from the course text. The task of
“guessing the number” should be modularized into a function called NumberGame.
(bonus: 2
points) Do exercise 6.39 (pg. 321). However, you don’t have to show (or
prove) that “any number from 1 to 1000 can be guessed in 10 or fewer
tries”.
Q2) (5 points) Do exercise 7.37. The
function recursiveMinimum should be part of a main
file called Exerc2.cpp. The starting/ending subscripts,
and the array values are read in by prompting the user. Assume that the array
size doesn’t exceed 10 elements.
4) How to turn in homework
- Turn
in ALL the required materials needed for grading at class-time on the due
date.
- By
default the following must be returned:
- Hard Copy:
- Page
1. A clearly written text stating the following things:
§
Course name
§
Assignment number
§
Your name
§
Your email
address
§
Date
- Page
2--n. Hard copy of all the source files that you wrote (e.g.
Assign1.cpp) and output. If you have multiple files, make sure you write
the file name on the first page of each file. If you are printing from Unix, the lpr -p print
command will do this for you.
- Soft Copy:
- Email
me a file ( [your_lastname_AssignmentNumber.zip
or your_lastname_AssignmentNumber.rar] together
with your hard copy. Use the WinZip or the WinRar
utilities to zip your files. I will not accept unzipped or unRAR’ed files. The file should be emailed to javedf@cis.uab.edu before the start
of the lecture on the due date. The file should include the following
files:
- Readme
file (explains how to set up, compile and run your program)
- Sources
files (the files you wrote)
- Test
files
- Output
files (test results)
- Makefile (optional)
- Note: Please staple your hard copy and put it in an
envelope. On the envelope write your name and assignment number.
4) C++ Resources
Send comments to the CS
304 TA