Hi,
I have an assignment due today that says
javascript:tx('Write a C++ program that calculates the sum of three integers. Your answer should have three (3) C++ files as described below:
A header file
It should define the prototype of a function calculating the sum of three integers. That is, this function has three parameters, and the data type of each parameter is integer. The value returned from this function is the sum of these three parameters.
A C++ program
It includes the implementation of the function defined in the header file.
A C++ test program
The purpose of this program is to test the performance of the C++ program you have
developed.
Its working procedure can be:
Define three variables. The data type of each variable should be integer.
Calling the function calculating the sum of three integers by passing the values of
the variables defined in the previous step.')
and what i did is this
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#include <iostream>
using namespace std;
int addNumbers ( int x, int y, int z){
int sum=x+y+z;
return sum;
}
int main() {
int a,b,c;
cout<<"Please enter the 3 integers: ";
cin>> a >> b >> c;
cout<<"the sum of the 3 integers is: ";
cout<< addNumbers(a , b , c)<<endl;
return 0;
}
|
i don't know how to divide it into 3 files ( header, c++ program, c++ test)
please help