Wyo C++ Ch. 5 Programming Assignment

  1. Ch5Proj1.cpp

    Suppose you are organizing a pizza party and will give every person who attends exactly 3 slices of pizza. Write a program that accepts a number of people and then computes the minimum number of pizzas that must be ordered assuming there are 8 slices per pizza. Your program must then display the number of slices that will be left over. In order to accept user input, you may have to look up how to use cin statements in the Ch. 6 notes if we haven't covered them yet in class. The program must use clear, explanatory input and output prompts. It must also use data types and constants appropriately.

    Your program must follow the Coding Standards. Save the source code file as "Ch5Proj1.cpp" in the appropriate network folder.

    Preconditions:

  2. Ch5Proj2.cpp

Steel measuring tapes vary in length slightly depending on the temperature. When they are manufactured, they are standardized for 20 degrees Celsius. As the temperature varies above or below 20 degrees Celsius, the tape becomes slightly inaccurate. The formula below will produce a length correction C given the length measured by the tape and the temperature in Celsius. (T = temperature, L = measured length)   

C = 0.0000116 * (T - 20) * L

The adjusted length can be calculated using the following formula.

new length = L + C

Note that it takes very large length's and/or very extreme temperatures to notice a change in the length of a measuring tape. Write a program that asks the user for a measured length in centimeters and temperature in Celsius (floating-point values are acceptable inputs). The program must output an adjusted length as a floating-point value in fixed notation using the formulas above. Make sure that the you use appropriate data types. Ch. 5 Demo Program #5 directs you how to display values with fixed notation rather than scientific notation.

Preconditions:

Your program must follow the Coding Standards. Save the source code file as "Ch5Proj2.cpp" in the appropriate network folder.

    1. The hardcopy source code for this assignment. Staple multiple pages together, if applicable.
    2. The typed pseudocode that you used to write out your C++ code. Please type this neatly following the specified template.
    3. The typed test plan (following the Excel template) that you developed before writing out the code. The test plan must include several reasonable inputs as well as boundary and any other special values. You should include as many test cases as necessary so that the test plan is thorough.

Former students have missed points on the this assignment for the following reasons:

  1. failing to use the proper header specified by the Coding Standards
  2. failing to use the proper method of naming variables (begin with lowercase letter and capitalize words that follow)
  3. using main( ) instead of int main( )
  4. not keeping the inputted value on the same output line as the corresponding prompt message
            Example:         Please enter the length of the tape: 60
  5. not using a colon and a blank space at the end of prompt messages
            Example:         see example above
  6. not including punctuation in output messages
            Example:         The adjusted length of the measuring tape is 60.1342 centimeters.
  7. not using white space to separate the input (cin), computational, and output (cout) areas of the program
  8. not documenting any computation/assignment statements within the body of the program
  9. spelling mistakes
  10. not including an end of main comment with the closing curly brace of the main function as in          } \\ end of main