Homework 5 UCR CS10: Introduction to Computer Programming Fall Quarter 2003, Lecturers: Brian Linard, Kris Miller Due Thursday, November 13 at the BEGINNING of lecture. 1. Self-test Excercise #4-9 2. Self-test Excercise #4-19 3. Self-test Excercise #4-20 4. Self-test Excercise #4-22 5. Self-test Excercise #5-4 6. Self-test Excercise #5-7 7. Self-test Excercise #5-10 8. Self-test Excercise #5-15 9. Write function definitions for the two functions declared in the following program so that they work as described in the pre- & post-conditions. #include using namespace std; void input_values( char& repeat, int& times ); ; pre-conditions: none ; post-conditions: first argument holds user response to question "do you want to play?"; second argument holds user response to question "how many times?" bool test_input( char in, int number ); ; pre-conditions: first & second arguments are initialized ; post-conditions: function returns true if parameter in contains 'Y' or 'y' ; AND parameter number is greater than 0. int main() { char yes_or_no; int number_of_loops; bool go_ahead; input_values( yes_or_no, number_of_loops ); go_ahead = test_input( yes_or_no, number_of_loops ); if( go_ahead ) { while( number_of_loops > 0 ) { cout << "you asked for this!" << endl; number_of_loops = number_of_loops - 1; } } else { cout << "you declined!" << endl << "you answered " << yes_or_no << " and specified " << number_of_loops << " loops." << endl; } return 0; } 10. What output do you expect from the program if the user inputs 'Y' and -32? Test your code MANUALLY to confirm your expectation. NOTE: questions 9 & 10 will be graded for actual points!!