Assignments

Assignments will maintained on this page. Consult it for details, speifications, expectations, hints and updates. At times the deadlines may not be achievable due to unexpected diffulties in the assignment or in your academic or personal lives. In such instances please request an extension via e-mail.

There will be three submission modes: via e-mail, via hard copy and by the homework submission program, hsp. Please regard the particular mode requested on each assignment. For details on hsp, see Homework Submission Program

Assignment #0

a) By class time on Wed., please send me e-mail from the address to which you prefer mail regarding this course be sent. Include the following information:

Reading: read Ch. 1 in Kruse.

Assignment #1

See the program rat0.cpp handed out in class.

a) List operations that you would want to have in a rational number class.

Due: Wed., format: handwritten.

b) Perform some of the updates as indicated there.

due date: classtime on Fri.

deliverables: program listing and sample rum.

See program rat5.cpp handed out in class and available on Accounts/courses/cs127/rnau
Modify it or your own rat program to


Due: classtime Mon
Deliverables: hardcopy of program and sample runs

Assignment #2

See the program stack1.cpp handed out in class and available on Accounts/courses/cs127/rnau
Modify it,or your own stack program, so that

Assignment #3

See the program stack31.cpp handed out in class and available on Accounts/courses/cs127/rnau
Modify so that

Assignment #4

Refer to the linked list implementation of a queue started in class
You should try to complete and test

Assignment #5

Refer to your linked list implementation of a stack and the program SQ.cpp in which a stack was derived from a queue. You are to write and test a program QS.cpp in which you derive a queue from a stack. For the sake of simplicity - do not use templates, and have your two classes and main() all in the same file.

Due: classtime Monday 4/16
Deliverable: hsp QS.cpp

Assignment #6

See the SnowFlake.cpp program on the account and discussed in class. Get rid of my main() and replace it by one that uses turtle graphics to draw squares, then pentagons, etc. Aim for generality. You might want to make a turtle class and file turtle.h.

Due: Let's see how far you get by classtime Wednesday 4/18
Deliverable: hsp - include "turtle" in the title

Assignment #7

See the program Pstrings0.cpp on the account and being discussed in class. In the comments are several suggestions for additional functions to add to the class, viz. length(), AllCaps(), Adds and Deletes and concatenation. Add and test some of these.

Due: As far as you can get by Monday 4/23
Deliverable: hsp - call it pstring.cpp please.

Assignment #8

See the program pizza.cpp on the account and used in the lab. In the comments are several suggestions for additional functionality to add to the program, viz. more and better colors, a new shape, better olives, red peppersl. pepperoni, etc.(), Add and test some of these.

Due: As far as you can get by Monday 4/23 also. You probably needn't spend much more time on it then you did in the lab.
Deliverable: hsp call it pizza.cpp

Assignment #9

See the program qsort.cpp on the account and discussed in class. Modify it so that rather than using recursion it uses a stack. Use a templated stack class. What to stack is the question. There are at least two possibilities. You can stack indices either in pairs (use a little Pair struct) or individual indices just so long as you Pop them in the reverse order. The indices represent the endpoints of the subarray to be sorted.

Hints:


Due: Friday 5/4
Deliverable: hsp call it qsort.cpp, include your templated stacks, call it stack.h.

Assignment #10

No programming. Rather several problems from the text:

Deadline: Wed, 5/9, 8:30 am

Format: hardwritten is fine

Assignment #11

Consider the airport7.cpp program demonstrated in class, which stores the airport codes in a tree. You will find a version of it on our class account. It does a number of things, but one thing it doesn't do is search. That's your job. In particular,

Deliverables: Your copy of the program via hsp.

Deadline: classtime, Wed 5/16

Assignment #12

Consider the zoo program demonstrated in class. You will find a version of it, named zoo.cpp, on our class account. However that version does not store the tree to a file and retrieve it. That's your job! You are to complete the outTree and inTree functions.

Some suggestions:

Deliverables: Your copy of zoo.cpp via hsp.

Deadline: Fri 5/18

Project