Computer Science Using C++
Ch. 14 Programming Assignment
Write a program that declares a vector of ten floating-point
values (use doubles). Have the program prompt the user for each of the ten
values and store all of them into the vector. The program should then report
how many of the values entered are larger than the very first value that
was entered. For example, if the values entered are 5.2, 6.1, 2.8, 8.9,
3.3, 2.0, 9.7. 1.4, 7.3, and 5.5, the program should report that 5 of the
values in the vector (besides the first one of course) are larger than the
value of the first element.
You must use an apvector rather than a C++ array. Your program must follow
the Wyo Area Comp Sci Documentation
& Coding Standards. Place a copy of Ch14Proj1.cpp in your Submit folder
so that the instructor can execute your program within that folder. Be sure
that any #include compiler directives have valid paths so that the instructor
will not have linking errors.
Preconditions:
Here are two example test plan items:
Possible Inputs |
Expected Output |
Reason for Test Item |
||
values |
number of values > the first | |||
1. | 5.2, 6.1, 2.8, 8.9, 3.3, 2.0, 9.7, 1.4, 7.3, 5.5 | 5 | normal case | |
2. | 1, 2, 3.333, 4, 0, 349, .99, 8, 9, 10 | 7 | normal case |
Computer Science Using C++ Home Page | Mr. Minich's Wyo Home Page