Exam 1 CS 141 Wednesday, September 30, 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 three of the problems, you need to write a program. You do not need to write comments, include statements, or meaningful variable names. 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 (15 points): A. Write a program to read in the age of ann, bill, and carl. Have your program print "yes" if ann is older than bill and carl or if ann is younger than bill and carl. Otherwise, it should print "no". ------------------------------------------------------------------------------ Problem 2 (15 points): Write a program to read in ten numbers and print the number of positive numbers read in. ------------------------------------------------------------------------------ Problem 3 (15 points): Write a program to read in numbers until an even number is read in, and print the sum of all the odd numbers read in. ------------------------------------------------------------------------------ Problem 4 (5 points): What exactly will this program print out: void main() { int i; for (i=1; i<=5; i++) cout << "x"; cout << "o\n"; }