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 1 A. Write a function called big3 with three integers as input parameters. The function should return the largest of those three numbers. B. Using the function from part A, write a program that reads in three integers then prints out the largest. ------------------------------------------------------------------------------ Problem 2 A. Write a function called movemax with three integer parameters. The function should make the third integer be the maximum of the first two. B. Using the function from part A, write a program that reads in two integers then prints out the largest. ------------------------------------------------------------------------------ Problem 3 Suppose I have written a function called prime, which takes an integer as argument and returns true if that integer is prime, false otherwise. Suppose I have also written a function called perfect which takes an integer as argument and returns true if that integer is perfect, false otherwise. (It is not necessary for you to know the definition of a perfect number). Using my functions, write a function called pp which returns true if there exists an integer between 1 and 1000 which is both perfect and prime. (When I say between 1 and 1000, I mean including 1 and 1000). ------------------------------------------------------------------------------