Exam 2 CS 141 Thursday, October 29, 1998 This is a closed-book, closed-notes examination. There are four problems. Do not spend too much time on any problem. Read them all through first and solve them in the order that allows you to make the most progress. For all of the problems you need to write a program. You do not need to write comments, include statements, or meaningful variable names. Assume that the type bool exists. You don't need any error checking. When you ask the user for information, just write something short. Your program doesn't have to be fancy or user-friendly. You should make it as simple as possible, as long as it does what is required. ------------------------------------------------------------------------------ Problem 4 A. Write a function called weight_drop which takes an array of integers and the size of the array as parameters. The array values indicate your weight on given days. Assume you began a diet on a certain day. Then position 0 of the array is your weight on the day you began the diet, position 1 of the array is your weight one day after you began the diet, position 2 of the array is your weight two days after you began the diet, etc. Your function weight_drop should return the first day that your weight dropped after you began the diet. If your weight never dropped then the function should return -1. B. Using the function from part A, write a function called diet14 that takes an array and the size of the array as parameters. The function should return true if your weight dropped within 14 days after beginning the diet, otherwise false.