Author:
Carol 96

http://theperfecthomework.com/cmis-102-week-4-hands-on-lab/

Learning Exercises for you to complete

1. Change the C code to sum 10 integers as opposed to 5? (Hint: Please don’t use arrays or Loops for this. We will be using those features in another week.) Support your experimentation with a screen capture of executing the new code

2. Using the code you create in step 1, modify the code to print an additional statement if the sum of the value is negative (Hint: Consider modifying the existing selection statement) Support your experimentation with a screen capture of executing the new code

3. Prepare a new test table with at least 3 distinct test cases listing input and expected output for the code you created after step 2.

4. Create your own C code implementation of one of the following mathematical formulas:

a. y = mx + b; (slope of a line) Assume the user will be prompted to input m, x and b andthe program will calculate y. If the value of y is greater than 10, inform the user thevalue is greater than 10.b. a = PI * r*r; (area of circle). Assume the user will be prompted to input the radius r. Youcan define PI as 3.1416. . If the value of a is greater than 10, inform the user the value isgreater than 10.c. v = 4/3 PI r*r; (volume of sphere) Assume the user will be prompted to input the radiusr. You can define PI at 3.1416. If the value of v is greater than 10, inform the user thevalue is greater than 10.

Be sure you provide not only the C code but a test table with at least 3 distinct test cases listing input and expected output your mathematical formula.

Tutorial