ENGR 221 Fall Semester 2007 Homework Assignment 3 Due Thursday, September 20, 2007 Write a C program, hwk3.c, to perform math operations on integer values. Allow the user to select from the following menu options: 1 – sum of integers 2 – product of integers 3 – sum of powers of integers Depending on the selection made by the user, perform the desired operation. The program should work for all integers. Sample output is given below. This program performs math operations. Enter a number 1 to 3 corresponding to the following options: 1 -- sum of integers 2 -- product of integers 3 -- sum of powers of integers 1 Enter the starting integer: 1 Enter the desired increment between integers: 1 Enter the ending integer: 7 The sum of integers between 1 and 7 incremented by 1 is 28. [user@students homework]$ ./a.out This program performs math operations. Enter a number 1 to 3 corresponding to the following options: 1 -- sum of integers 2 -- product of integers 3 -- sum of powers of integers 2 Enter the starting integer: 2 Enter the desired increment between integers: 2 Enter the ending integer: 8 The product of integers between 2 and 8 incremented by 2 is 384. [user@students homework]$ ./a.out This program performs math operations. Enter a number 1 to 3 corresponding to the following options: 1 -- sum of integers 2 -- product of integers 3 -- sum of powers of integers 3 Enter an integer: 4 Enter a starting power: 0 Enter an increment for power: 1 Enter an ending power: 5 The sum of powers of the integer 4 with the powers starting at 0, incremented by 1, and ending at 5 is 1365. [user@students homework]$ ./a.out This program performs math operations. Enter a number 1 to 3 corresponding to the following options: 1 -- sum of integers 2 -- product of integers 3 -- sum of powers of integers 4 Enter a number 1 to 3 corresponding to the following options: 1 -- sum of integers 2 -- product of integers 3 -- sum of powers of integers If the user does not enter 1,2, or 3, the program must print the menu again as shown above. Use an infinite while loop in conjunction with break and continue to accomplish this. Incorporate a switch statement with default clause as well as a do/while statement in your program. The program must not allow division by zero. Save your program as hwk3.c in your homework directory. Include your name and hwk3.c in comment lines at the top. Print out a copy of the program with sample output and add a flowchart on the same page. Turn this in for grading. Email a completed copy of your program to both the instructor and the grader prior to the start of class on the due date. In the subject line of this email, type ENGR 221 hwk3.c. Send it as an attachment from your IPFW webmail account, which can be accessed through https://my.ipfw.edu/. If you are working from home or a campus lab other than the engineering labs, you can access the file by logging into http://students.etcs.ipfw.edu and transferring it from your homework directory to the local computer. Once the file is on the local computer, you can attach it to an email. In class, turn in a hardcopy of the program with your results appended at the bottom and with the flowchart. Make sure the version you email does not have these appended results because it will not compile. Grading: Program written correctly & results accurate Comments and style Program compiles Flowchart 4 pts. 2 pts. 2 pts. 2 pts. 10 pts.