Saint Louis University |
Computer Science 146
|
Dept. of Math & Computer Science |
Topic: Part II warmup
Due:
11:59pm Tuesday, 19 February 2013
Related Reading: Pages 19-28 of case study
Please make sure you adhere to the policies on academic integrity.
With this assignment, we begin what is described as "part II" in the associated reading. We will be using our own revision of the source code originally provided with the AP case study (in particular, we will be using the standard C++ string and vector classes, rather than the custom "apstring" and "apvector" classes used in the original case study).
If you are working on turing, you may get your own copy of the required source code for part II of the case study by directly copying our version with the following command (note well the period at the period at the end of the command):
cp -Rp /Public/goldwasser/146/partII .This will cause a new folder named partII to appear in your working directory including all files that you need for this assignment. Note: if you have a C++ compiler on your personal computer and wish to work directly on that computer, the necessary files may be downloaded here as partII.zip.
For convenience, our distribution includes a makefile that will allow you to (re)build the project using the command make. This produces an executable named fishsim that can be executed with the command:
./fishsimFor convenience, we have added another feature not discussed in the reading, allowing you to execute your program using a data file with a name other than the default fish.dat. This is done by providing the data file name as a command line argument when executing the program, as in
./fishsim other.datThis way, you can keep several different data files stored in your account, and more easily switch between them when running the program.
You are to go through pages 19-28 of the case study, answering most exercises, and performing all interactive experiments described. Specifically, you are to provide responses to:
Questions 1, 2, and 3 on page 20.
Reply to the "Stop and help" and "Stop and predict" prompts on page 22. For the "stop and predict" question, you do not yet need to create data files for the proposed environemnts. Just describe what environment you would set up to test some of your hypotheses.
Answer the three questions on page 24, labeled as "Stop and predict", "stop and help", and another "stop and help".
Do all questions on page 28. For the final Application question, rather than prompt the user for the position of each fish, randomly generate initial positions for the desired number of fish. Implement this program in a file named makerandom.cpp.
Your assignment should be submitted electronically (details on the submission process). This should include your summary prose document, as well as any modified versions of source code. In particular, submit the updated version of fishsim.cpp after modification 3 on page 20, and the new makerandom.cpp application.