CSCI 201 Spring 2001: Assignment 2

Program 1: Work assignment number 4.9 on page 149 of the text

Write a program called parts.cpp to perform the task described in problem 4.9. Because your progam will be automatically graded, you must observe the following restrictions:

The sample run on page 150 of your text meets these requirements as does the sample run displayed below.
  Choices of hair style are:
  (1) wavey
  (2) straight
  (3) wild
  (4) bushy

  enter your choice: 3   (the first integer input)

  Choices of face length are:
  (1) short
  (2) medium
  (3) long

  enter your choice: 2   (the second integer input)

  Choices of mouths are:
  (1) happy
  (2) sad
  (3) suprised
  (4) silly

  enter your choice: 4   (the third integer input)

  Choices of chins are:
  (1) pointed
  (2) square
  (3) rounded

  enter your choice: 1   (the fourth and final integer input)

Program 2: Work assignment number 4.4 on page 148 of the text

Write a program called power.cpp to raise a real number to an integer power.

Programming Style

Note that 10% of your program grade is based on the readability of your program. This includes things like style, comments, and the naming of variables and functions. Make sure you include a comment at the top of each program with your name, course and purpose of the program specified.

// Name: YOUR NAME HERE // // Course: CSCI 201 // // Purpose: purpose of program here //

Turning in your programs

The programs written for this assignment must be turned in by transferring the C++ source code files to your ftp directory for this class. Only the source code files (i.e., parts.cpp and power.cpp) should be turned in. You were shown how to transfer files to your class ftp directory in lab01, here is a quick repeat.