


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



This problem set is due on Thursday, September 3 at 11:59 p.m. via electronic handin. No submissions will be accepted after I disable handin sometime on the morning of Friday, September 4. Anything that is handed in before I disable handin will be considered on time.
You are to create a zip file as detailed later and submit it with the command
handin cs3500 ps1 ps1.zip
from any CADE Lab computer. Alternatively, you can use web-based handin at
http://cgi.eng.utah.edu/webhandin
A filter is a command-line program that reads lines of text from its standard input stream, processes them in some way, and then writes lines of text to its standard output stream. Typically, a filter doesn’t wait until it has read all of its input before it begins writing output; it begins producing output as soon as possible.
In this assignment you will be getting used to Visual Studio and C++ by creating a single solution (called PS1) that consists of three projects, each of which is a filter. The three filters are:
For the purposes of this assignment, a word is a sequence of non white space characters delimited by white space.
As a starting point, I am giving you a solution called PS1 that contains the completed project Format. It is linked as ps1-skeleton.zip from the calendar on the class web page. To get started, unzip it into the directory of your choice and double click on the .sln file that it contains. That will bring up Visual Studio so you can work on the solution.
You should study Format to see how a filter can read and write words from and to standard input and standard output. You should then implement and test the projects LowerCase and Palindrome.
Here are a few hints beyond those you can glean from studying Format:
To run one of the filters from Visual Studio, first make sure that the desired project is the default project. To do this, right click on the project name and select “Set as StartUp Project”. Then press the F5 key. A terminal window will appear.
Whatever you type into this window will be passed to the filter via its standard input stream, and whatever the filter writes to its standard output stream will appear in the terminal window. To end an interaction, enter CTRL-Z (the DOS end-of-file character).
Running Format requires an extra step because it requires a command line parameter. Right click Format, choose Properties, and then choose Debugging under Configuration Properties. Enter the desired command line parameter on the line labeled Command Arguments.
Visual Studio is a development environment. Ultimately, you need to be able to run your three programs independently of VS.
To do this, open a terminal window and navigate to the folder that contains your three executables. You can run the one of your choice by entering one of these commands into the terminal:
When you’re ready to hand in your solution, under the Build menu choose Clean Solution, which will delete temporary files. Exit Visual Studio. Use Windows Explorer to navigate to the directory in which you solution resides.
It will be very helpful if you’ll delete some unnecessary files before zipping up your work. Find and delete your .ncb file (but not your .sln file). You can also delete your Debug and Release folders.
Zip your solution into a file called ps1.zip by right clicking on the root folder of your solution and choosing “Send to Compressed Folder” or something similar. Your zip file should be a few kilobytes. If it’s anywhere near a megabyte you’ve left in some unneeded files.
We should be able to unzip all of your files into a directory, double click on your .sln file, and build the project without any errors.
You should be able to do this also! Try it before you hand it in!
You should be able to do this also! Try it before you hand it in!
You should be able to do this also! Try it before you hand it in!
You should be able to do this also! Try it before you hand it in!