+447737184217 support@onlinenursingwriter.com
Custom Essays Writers

two c assignments and easy works by using codeblcoks 2



Additional requirement: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_x000D_

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 decimalTotalWrite 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:_x000D_
1 + 2 + 3 = 6_x000D_
_x000D_
For decimal numbers:_x000D_
1.10 + 2.20 = 3.30_x000D_

Test the program once with the values 4, 5, 6, 7, 8.1234, and 9.5678
 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount! Use Discount Code "Newclient" for a 15% Discount!NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

The post two c assignments and easy works by using codeblcoks 2 appeared first on My Nursing Experts.