/*** function: Establishes a header file, declares a set of functions, has a variable parameter, and the return value includes Void,char,*int,float. Create a. cpp file that contains the above header files, creating a definition of all these functions. Each * definition should simply output the function name, the argument list, and return the type to know that it has been called. * Create another. cpp file that contains the header file and defines an int main () in which to invoke all the * functions that have already been defined. * Time: August 15, 2014 08:18:02*cutter_point*/#ifndef test1_h_included#define test1_h_included#include<iostream> Using namespace std;//declares a set of functions with variable parameters, the return value includes void,char,int,float//function void, declares void fun1 (int),//char function declaration char fun2 ();// The INT function declares int fun3 (float);//float function declares float fun4 (char); #endif//test1_h_included
/*** function: Establishes a header file, declares a set of functions, has a variable parameter, and the return value includes Void,char,*int,float. Create a. cpp file that contains the above header files, creating a definition of all these functions. Each * definition should simply output the function name, the argument list, and return the type to know that it has been called. * Create another. cpp file that contains the header file and defines an int main () in which to invoke all the * functions that have already been defined. * Date: August 15, 2014 08:18:08*cutter_point*//* create a. cpp file that contains the above header files, creating a definition of all of these functions. Each definition should simply output a function name, a parameter list, and return a type to know that it has been called. */#include "test1.h" #include <iostream>using namespace std;void fun1 (int a) {//Simply output function name, parameter list, and return type to know that it has been called cou t<< "The function fun1 (" <<a<< ") has been called ..."; cout<< "\treturn void\n";} Char returns the type char fun2 () {///simply outputs the function name, the argument list, and returns the type so that it has been called cout<< "the function fun2 () has been called ..."; cout<< "\treturn char:y\n"; Return ' Y ';} int return type int fun3 (float f) {///Simply output function name, parameter list, and return type to know that it has been called cout<< "the function fun3 (" <<f<< ") has been called ... "; cout<< "\treturn int:1\n"; return 1;} Float return type float fun4 (char c) {///Simply output function name, parameter list, and return type to know that it has been called cout<< "the function fun4 (" <<c<< ") H As been called ... "; cout<< "\treturn float:7.1f\n"; return 7.1f;}
/*** function: Establishes a header file, declares a set of functions, has a variable parameter, and the return value includes Void,char,*int,float. Create a. cpp file that contains the above header files, creating a definition of all these functions. Each * definition should simply output the function name, the argument list, and return the type to know that it has been called. * Create another. cpp file that contains the header file and defines an int main () in which to invoke all the * functions that have already been defined. * Time: August 15, 2014 08:18:13*cutter_point*///#include "test1.h" #include "test1.cpp" #include <iostream> #include <cstdlib>using namespace Std;int Main () { fun1 (998); Fun2 (); FUN3 (3.8f); Fun4 (' L '); System ("pause"); return 0;}