ENGR 112 HOMEWORK #3 (COMPLETE) Due: 11:59 P.M. Monday, September 25, 2006 NOTE: Please follow your lab instructor's directions for submitting your assignment to your ENGR 112 section on http://csnet.cs.tamu.edu. NOTE: Homework will be graded by how it runs on unix.cs.tamu.edu. You may develop and test your homework on any platform, but make sure it runs correctly on unix.cs.tamu.edu. NOTE: Begin each file according to the following sample-- // hw3pr1.cpp (assignment number and problem number) // // ENGR 112-5xx (your section number) // Due 11:59 P.M. Monday, September 25, 2006 // In support of the Aggie Honor Code, I have neither given nor received any // unauthorized help on this assignment. 1. (10 points) One form of the Goldbach conjecture says that every even number greater than 3 can be written as the sum of two primes, e.g., 4 = 2 + 2 6 = 3 + 3 8 = 3 + 5 10 = 3 + 7 (or 5 + 5). Write a C++ program which inputs a number, checks to be sure it is even and >3, and then prints two primes which add up to that number. Name your program hw3pr1.cpp. Hint: Reuse your is_prime function from the previous homework. 2. (10 points) Twin primes are primes which differ by 2, e.g., 3, 5 5, 7 11, 13 and so on. Write a C++ program to print the first 1000 such pairs, i.e., print these three pairs and the next 997 pairs too. Name your program hw3pr2.cpp. 3. (10 points) Do Drill 6.10 and submit the final version of the program as hw3pr3.cpp. Note: The calculator02buggy file is at http://courses.cs.tamu.edu/daugher/cpsc121/06fall/calculator02buggy.