CS 202 Fall 2013  >  Assignment 3

CS 202 Fall 2013
Assignment 3

Assignment 3 is due at 2 p.m. Wednesday, October 2. It is worth 30 points.

Procedures

Complete each of the exercises below. Then turn in your work as follows.

  1. Run Check. Demonstrate the programs you have written for the exercises below to either the instructor (Glenn G. Chappell) or the T.A. (Zak Williams). Get official approval.
  2. Submission. Submit your code using Blackboard, under Assignment 3 for this class. You should only submit code that has already passed the Run Check. Be sure you attach your source/header files; do not paste them into the text box. Also, send only source & headers; no project files or executables.

We may not look at your homework submission immediately. If you have questions, e-mail me.

Exercises (30 pts total)

Do each of the following exercises.

  1. From the Chapter 9 Programming Challenges (p. 537), do exercise 1. In addition, write a driver program that deletes the pointer and then prints a message.
     
  2. From the Chapter 9 Programming Challenges (p. 537), do exercise 3.
     
  3. From the Chapter 9 Programming Challenges (p. 537), do exercise 12. In addition, write a driver program that creates an array, prints its contents, calls the function, prints the contents of the returned array, and then deletes where necessary.
     
  4. From the Chapter 14 Programming Challenges (p. 862), do exercise 1.
    • Implement your class in separate source & header files. Thus, you will need to turn in three files for this exercise: the header and source for the class, and the source for your driver program.
     
  5. From the Chapter 14 Programming Challenges (p. 862), do exercise 2.
    • Implement your class in separate source & header files, as in the previous exercise.
     

Coding Standards

The following standards apply to all submitted homework in this class.

First:

For submitted code that is graded:

Standard C++

Code must be written in Standard C++, following standard conventions regarding filenames, the use of header and source files, #include,

Code must be const-correct. In particular, non-static member functions whose specification indicates that they do not modify the object they are called on, are required to be const.

Namespace Pollution

using namespace std;” should be avoided.

Comments

Code should include enough comments to allow the reader to determine:

  • Who wrote the code, when, and why.
  • What each module (function, class, struct) is for.
  • How any obscure/difficult portions of the code work.

All comments in code must be correct.

Quality

Code should be neat and readable.

Programs should not “look buggy”. If it looks like you tried to do something and failed, then I will be not be inclined to give you full credit.


CS 202 Fall 2013: Assignment 3 / Updated: 26 Sep 2013 / Glenn G. Chappell