Wyo C++ Ch. 5 Programming Assignment
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:
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) * LThe 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:
- You are guaranteed that the user will input positive floating-point values greater than 0 but less than DBL_MAX.
Your program must follow the Coding Standards. Save the source code file as "Ch5Proj2.cpp" in the appropriate network folder.
Former students have missed points on the this assignment for the following reasons: