### Assignment I

For each problem:

• Use the lab instructions given on the Internet at http://voyager.deanza.edu/~oldham
• Use the same format for the opening comments as in assignment A, with your name, course and quarter, assignment, problem, and short problem description.
• Create a program to meet the requirements of the problem.
• Correct any errors.
• Run the program with the specified data and save the execution results in an Execution Results comment at the end of your program.
• Print the program from Code::Blocks.
• Staple all the problems for this assignment together.

In these problems, and all future problems, use functions.
Provide a function prototype for each function before the main function.
The function prototype should have descriptive names for the function and for each parameter.
Put very little code in the main function.
Each function should be preceded with a short comment giving:

• A long line of asterisks as an eye catcher
• The purpose of the function
• Parameters, other input, and initial conditions
• Return values, other results, and final conditions provided

### Problem I1

In the main function, define four variables of type int, named: first, second, third, and total.
Write a function named getData that asks the user to input three integers and stores them in the variables first, second, and third which are in the main function.
Write a function named computeTotal that computes and returns the total of three integers.
Write a function named printAll that prints all the values in the format shown in the following sample:

```1 + 2 + 3 = 6
```

Call the other three functions from the main function.

Test it once, with the values 4, 5, and 6.

### Problem I2

In the main function, define five variables of type int, named: first, second, third, fourth, and total. Also in the main function, define three variables of type double named: decimalOne, decimalTwo and decimalTotal
Write one function named getData which asks the user for the data and puts it in first, second, third, fourth, decimalOne, and decimalTwo. (You may copy your getData from problem I1 and make additions to manage fourth, decimalOne, and decimalTwo.) Write a function named computeTotal which can take two, or three int arguments and returns an int. Write another function, also named computeTotal which takes four int arguments and returns an int. Write another function, also named computeTotal which takes two double arguments and returns a double. Write a function named printAll which takes three arguments of type int. Write a function named printAll which takes four arguments of type int. Write a function named printAll which takes five arguments of type int. Write a function named printAll which takes three arguments of type double.

In the main function, after calling the getData function make the following function calls:

• call computeTotal passing first and second, then call printAll to print the results.
• call computeTotal passing first, second, and third, then call printAll to print the results.
• call computeTotal passing first, second, third, and fourth, then call printAll to print the results.
• call computeTotal passing decimalOne and decimalTwo, then call printAll to print the results.

Print the results int the formats shown in the following samples:

```For integers:
1 + 2 + 3 = 6

For decimal numbers:
1.10 + 2.20 = 3.30
```

Test the program once with the values 4, 5, 6, 7, 8.1234, and 9.5678