C M S C     2 1 4
C o m p u t e r   S c i e n c e   I I
F a l l   2 0 0 3


Project #0

Due Monday, September 15th, by 11PM

Preliminary Material

Project 0 is worth 1% of your grade.

As with all projects it is extremely important to begin early. While completing this project, in addition to having a C++ reference (like the CMSC 114 text) handy, you should review the tutorials posted on the main class webpage - even if you are already familiar with UNIX it would be wise to review those tutorials as well.

There are generally a number of details contained in a project description such as this one. Please note that failure to follow the details outlined in the project description could result in a substantial loss of points so it is very important to pay close attention to the project description.

Purpose

The goals of this project are to:

  1. Set up and become familiar with your class account.
  2. Review material from CMSC 114 (linked lists, dynamic memory and operator overloading, among other items).

Academic Integrity Statement

Please note that all programming projects in this course (including this one) are to be done independently or with the assistance of the instructional staff of this course only.

Please review the policies outlined on the class syllabus concerning the use of class computer accounts and concerning the University's Code of Academic Integrity. The instructors of this course will review the programs submitted by students for potential violations of the Code of Academic Integrity and if it is believed that a violation has occurred it will be referred to the Office of Judicial Programs and the Student Honor Council - even for a small project only worth 1% of your overall grade.

Hardcoding is considered a violation of academic integrity

If you are unclear about any of the policies of this course you should ask either of the instructors for further clarification.

Style Guide

Students are expected to write "clear and legible" code. Please review the following Style Guide which specifies how students in CMSC 214 are expected to lay out their code:

http://www.cs.umd.edu/class/fall2003/cmsc214/Projects/styleguide.txt

FAQ

Answers to "frequently asked questions" will be posted via the main projects page. Prior to asking a question or submitting a project you should check the FAQ to see if any important information has been covered there. In addition to answers to FAQ's, any important information pertaining to a project will be posted on it's FAQ.

Project Overview

------
PART I - Logging in, setting up, and using your account
------

Note - Even if you are familiar with Unix failure to follow these instructions as listed may result in your being unable to complete PART II and this assignment as a whole.

Log in to your class account using ssh, putty, or some other similar remote-login program (use telnet as a last choice). You should log in (connect) to the hostname dc.umd.edu and use your class login id (jm214xx or bt214xxx) and the password given.

Note that once you successfully log in a number of screens of information will appear. Continue to press 'q' (Q for quit) until you get to the UNIX prompt (% ).

At the UNIX prompt run the dce_login command to "authenticate" your login session (this is only needed when running the setup program and/or changing your password) - be sure to use your class login ID (as the "Principle Name") and then your password.

After authenticating your session run the following command:

    ~jm21401/setup      or     ~bt214001/setup

depending upon which section you are in (your login ID is a hint).

After running the setup program you should change your password (passwd) and then your finger information (chfn) - note failure to change your finger information may result in loss of points on this and future projects - you should at least modify your finger information so that it reflects your real name (other information you may leave blank). Do not put your nickname down for your finger information - it should be your first and last name. Note: it may take up to 24 hours for your finger information to take effect - that is normal.

Now log out and log back in and then your account will be successfully set up and you should see the current class announcments displayed when you log in. NOTE: to log out you will need to type exit and then give the logout command (logout) - you only need to do this (type exit) this time because of the "authentication" that the dce_login command did.

After logging back in you should practice using your account a little to become familiar with the computer system. Do NOT forget to log out when you are all done.

NOTE: the setup program "installed" various things and if you fail to run the setup program then you will not be able to submit your projects. Also the setup program modified cxx to automatically use the options -std strict_ansi and -w0 (by aliasing the command). So, at the unix prompt if you wish to compile a file you just need to type cxx and then the name of the file and it will automatically include the required options. HOWEVER, in a makefile you must explicitly use the two required options with the cxx command, because the makefile does not use the "aliased" command.

------
PART II - creating (and testing) the DoubleStack and MyString classes
------
You can find the header files and other misc. files for this part of the project in the class posting account in the following directory:
    ~jm21401/Projects/P0/    or     ~bt214001/Projects/P0/
Both posting accounts contain the exact same information (in fact one directory just links to the other one).

For this part of the project you will be writing the code for several classes. One of the classes is called DoubleStack and it uses a dynamic 1-dimensional array to store two stacks of characters. A limited amount of functionality is provided and is all that you are required to do - details of which are provided in the TXT.README file found in the class posting account. The other main class is called MyString and is a user-defined "string" type (yes one already exists), which uses a singly linked list of characters to store the letters of the string. Note that both these classes are independent of one another and are very "contrived" to test basic concepts covered in CMSC 114 that are important to know in CMSC 214.

There is a readme file in the directory above (in the posting account) with further details - be sure to read the details in the readme file (named "TXT.README").

It is strongly recommended that you create a new directory in your account (name it P0 or something like that) and copy the files from the posting account's P0 directory over into your account so you can then use and edit them. Perhaps you should create a subdirectory named P0/posting and put the files in there and then another directory P0/working where you will start writing and testing your code.

Sample I/O

For this project you have been provided with a main.cpp file which can be used to test several items of the classes. Note however that it does not test all of the components of the classes and it is your responsibility to do that separately. When we grade your Project #0 we will test all of the required functionality of the classes (see the readme file for details as to what is required for you to complete with the classes).

For this project, like most projects, you have been provided with a primary.input and primary.output file. Both of these files can be found in the posting account in the appropriate directory. In order to pass the MRC (minimum running criteria) for this project your program must generate the primary.output when tested with the primary.input as follows:

%  cxx  main.cpp  DoubleStack.cpp  MyString.cpp  Node.cpp
%  a.out  < primary.input  > my.output
%  diff  -bwi  primary.output  my.output
%

The first line (cxx main.cpp ...) is an "easy" way to compile the main.cpp program to create a.out. You should create a makefile that can do this as well, however this is how you can do it if you aren't yet able to create/use a makefile (note: you will have to create a makefile in all future projects, so now is your time to learn how without penalty).

The second line (a.out < prima...) is a way to run the a.out program and redirect input (<) to come from the primary.input file (instead of the keyboard) and have the output redirected (>) to the file my.output (instead of the screen). You can also just type a.out and press enter and interactively run the program.

The third and final line (diff -bwi ...) is how we will test to make sure that your output (my.output) matches the expected output (primary.output). The diff command will print to the screen any lines in your file that do NOT match with the corresponding lines in the other file - if nothing gets displayed that is good news - it means that your output matches the expected output. The -bwi options tell the diff command to ignore case (be case-insensitive) and to ignore extra blank spaces. You should strive to have your output diff with the primary.output without the -bwi options, as that forces you to have a "more perfect" match - however when grading we will always use the -bwi option.

NOTE: in addition to the primary input and output there is a primary.input.light and primary.output.light and that for full credit on project #1 your program must pass the primary.input test, however for partial credit (more than likely 50%) you project must pass at least the "light" version (little to no other testing will be done).

Hints

Various hints appear in the readme file found in the class posting account.

How to Submit

For this project you must submit only the following 8 files:

  • main.cpp
  • DoubleStack.h
  • DoubleStack.cpp
  • MyString.h
  • MyString.cpp
  • Node.h
  • Node.cpp
  • makefile

Note: some of the files above may or may not have been modified and the makefile you have to create on your own. If you were unable to create a working makefile then you should still create the file and put a message to that effect inside the file - you will not loose points on this project for having a non-working makefile, however you will loose substantial points on future projects if you submit a non-working makefile.

To turn in a single file in this class you use the submit program/command and provide it with the name of the file (and only one file) that you wish to submit and then the project number you are submitting. For example:

%  submit  proj0.tar  0
So the problem is that submit will only allow you to turn in one file. If you submit main.cpp and then DoubleStack.cpp, submit will erase your first submission and replace it with the second file. So, to fix this "problem" you need to tar together all of the files above into one tar file and then submit that (which we can then untar when we grade your submission). To tar the files you must use the UNIX tar command as specified here and in class:
%  tar  -cvf  proj0.tar  DoubleStack.cpp DoubleStack.h MyString.cpp MyString.h Node.cpp Node.h main.cpp makefile
NOTE: you should make a backup copy of all of your files before you attempt to tar them together! We will not grant extensions due to mistakenly deleted files and if you use the tar command incorrectly there is a good chance of deleting one or more files.

After you have tar'ed your files together you can submit them - note that the submit command will display information to the screen and you should read that information to make sure your project submits successfully - if you do not see a message stating that your project was submitted then you should assume that it did not get submitted.

Also after (or even before) you submit your tar file you should check to make sure it is ok. To do this you can create a temporary directory and copy the tar file into it and then untar it:

%  tar  -xvf  proj0.tar
and check to see that everything was in there (and that the files compile and run correctly after being untar'ed). Note: You should do this in a "new/clean" directory and you should clean up afterwards so that you don't get confused as to which file you submitted and which you did not.

If you encounter any difficulties you should attempt to see someone during office hours as we are unable to assist with projects via email. You can find the office hours posted on the main class webpage. Additionally you should check the FAQ online to see if your question has already been answered.


See the class syllabus for policies concerning email
Last Modified: Wed Sep 3 13:17:01 EDT 2003
left up down right home

Web Accessibility