CS 14 - Lab 2


CS 14 Homepage

Mystery Program

In this lab you will be given a compiled program, as well as the sample solution for the previous lab (which might be useful). You are to write a program that behaves as similarly to the mystery program as possible. To make your task a bit easier, this lab is to be done in pairs.

The Assignment

Download these two files: Find a partner. You will work on this lab with your partner, but you should BOTH submit the results of your work.

2 points Attendance is, as always, worth 20% of your lab grade.

7 points Create a file called "solution.cc". In that file, duplicate the functionality of the mystery program. Ideally, for every input your program and the mystery program will produce the same results. Hints: .4 points There are 2 secret commands. Identify them and implement them in your own program. (You might want to google for "binary strings unix")

.4 points What data structure is this program implementing? (The answer is not linked-list.)

.4 points Do not include the linked-list operations from list.cc in your solution.cc file. Create an appropriate header file and a Makefile that builds both of these .cc files into .o files and links them. Google for help.

When you are finished, use the CS department Turnin to submit your work. Make sure to submit a copy for each partner.

© 2003 UC Riverside Department of Computer Science & Engineering. All rights reserved.