|
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 2 |
Project 0 is worth 1% of your grade.
This project will be to write a program (according to the specs below) which determines whether or not input strings are palindromes. For purposes of this project, a palindrome is defined as a string of characters that reads the same backwards as forwards, after all puncuation and spaces have been removed and all uppercase letters have been converted to lowercase letters. An example would be: "Poor Dan is in a droop" (no offense Dan) - if one removes the punctuation and spaces, and changes all characters to lowercase, this is a palindrome. "2002" is another example of a palindrome.
For the most part, this project is intended to be a review of material and concepts already learned and at the same time to introduce a couple new concepts that will be used in future projects. Several of those concepts are:
In addition, students are expected to setup and become familiar with their class computer accounts.
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.
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 layout their code:
http://www.cs.umd.edu/class/fall2002/cmsc214/Projects/styleguide.txt
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.
You should log in to your class account (see the project FAQ for how to obtain a class account if you don't already have one) and change the password (passwd), run the setup command (see below), and update your finger information (chfn) to reflect your real name (this is a requirement and will be graded) - you do not need to put your address or phone number in your finger information, just your real name. Note that when you log in you may need to press the "q" key several (3 or more) times to quit out of the newsreader program that you get initially placed into. When you get to a % prompt then you can type in Unix commands.
Running the setup command - this is one of the first things you should do once you log into your account, otherwise other things might not work (like the compiler and the submit command). If your login id begins with bt214 then you should type the following at the Unix prompt (%):
~bt214001/setupIf your login id begins with ch214 then you should type the following at the Unix prompt (%):
~ch214001/setupThis will run the setup command on your account and it should display a message to the screen. You should only need to do this once and you should only run the setup command that corresponds to your account. After running the setup command you should log out and then log back in to your account and it (the setup process) will then be complete.
For this project you will be required, among other things, to write the code for two classes:
The header files are purposefully absent from this project description as that will force you to log in to your class account and use the Unix copy command to copy the header files from your posting account into your personal account. See the FAQ or Tutorials webpage for further details if you are not familiar with using Unix (remember practice makes "better" and you should practice the Unix commands, found in the tutorials, using your class account).
After copying the header files (which are named StringEditor.h and Palindrome.h) into your account you should create the corresponding StringEditor.cpp and Palindrome.cpp files and write the code that implements the member functions for those two classes. Note: you may *not* change the header files in any way.
In each header file you will find the class with it's data member(s) and member function(s). There is a comment before/around each member function describing what it should do and you are to implement (aka write the code for) the member function so that it does what the comment states that it should and nothing more.
Next you should write a couple of "driver" programs to test each of your classes. Note that when developing/writing code you should do so in pieces/parts and test them as you go (and keep backup copies!).
And finally you should write a:
Your main program should use the two classes created earlier to accomplish it's task and you may *not* write any other classes.
A primary input file and a primary output file are provided on the main class projects webpage. These files are also in the class posting accounts (in the appropriate directory). You should review these files. They will be named input1.txt and output1.txt respectively.
You may not assume that the input file will always begin with a character and all words will be separated by exacly one blank. There may be several blanks before, after, and between words.
When your main program is compiled and run with input redirected so that it gets the contents of the primary input file (named input1.txt) as input, it should generate output that matches the primary output file. When we test your program we will diff your output (using diff -bwi) with that of the primary output and if it does not match then your program will be considered to not meet the minimum running standards and you will be unable to turn it in.
When testing your projects we will use the cxx compiler found on the class cluster. Therefore it is *highly* recommended that you test your program(s) using this compiler as well as we will not test programs with any other compilers. Also we will use the -w0 and -std strict_ansi options when compiling and thus you should as well. For example one way to compile main.cpp (without using a makefile) could be to type:
cxx -w0 -std strict_ansi main.cpp StringEditor.cpp Palindrome.cppNote however that if you have run the setup command the cxx compiler has been "aliased" to automatically use the -w0 and -std strict_ansi options when you run it at the Unix prompt (but *not* when you use cxx in a makefile, thus you must remember to include the -w0 and -std strict_ansi options when using cxx in a makefile).
You must write a makefile (named makefile) for this project and that makefile should contain at least the following target:
The p0 target in the makefile should be the very first target in the makefile and it should result in the main.cpp file being compiled and a final executable named p0 should be created that is a complete program to solve the main task of this project (so the other .cpp files may need to be compiled for this to work). The executable must be named p0 and not anything else otherwise you may lose several letter grades on this project.
In order to successfully submit your project, it must pass the primary input and produce the primary output. We will use "diff -bwi" to test your code. This ignores case, treats N blanks as 1 blank, treats N blank lines as 1 blank line. We will also strip all blank lines from your input when matching to ours. However, diff is sensitive to punctuation, number of dashes, etc. so you should attempt to make your output match ours as closely as possible otherwise you may not be able to submit your program. If this is the case (that your program does not submit) you must fix your code until the output it produces matches that of the primary output. Note: "hardcoding" output is a violation of the University's Code of Academic Integrity.
To submit your project you must first combine the following files (and only these files) into a single tar file using the Unix tar command:
You may name your tarfile anything you want, but p0.tar is the suggested name.
NOTE! You should make a backup copy of all your files BEFORE attempting to create your tarfile!!!! You have been warned.
After creating the tar file you should submit that one file using
the following command:
submit p0.tar 0 SUBMIT
where p0.tar can be replaced by whichever tar file you
have created, and 0 refers to the current project,
and SUBMIT refers to a subdirectory that is created
by the submit program. You may name this subdirectory
any name you want. We use "SUBMIT" as a sample.
This directory (SUBMIT) should NOT exist in the current directory prior to running the "submit" command. Either remove the directory and its contents if it does exist, or give it a different name.
If you forget the syntax, simply type "submit", hit return, answer the academic integrity question, and it will tell you the syntax.
Also, if you wish to find out why your project did not submit, go into the temporary directory just created. Look for a file called "214_p0_diff_file". That file will contain the diff between your output and the primary output. It should help you determine what went wrong.
Note: these are all from last semesters course.
|
See the class syllabus for policies concerning email Last Modified: Tue September 3, 2002 |
|
|
|
|
|