// ******************************************************************** // Author: Zhixiang Chen // Class: CSCI/CMPE 1170, Spring 2009 // Lab 14: Simple functions, header files // Date: January 12, 2009 // Revised on: 06/26/2009 by sirisha surisetty // Comment: The code here is meant to be revised. // //--------------------------------------------------------------------- // // This lab exercise is to practice simple function definitions // and callings, header file creation and inclusion. // We practice four basic types of functions: void type without // parameters; void type with parameters; value-returning type without // parameters; and value returning type with parameters. // // Compile and run your program. When everything is fine, // print your .cpp file and turn it to me or the TA. // ********************************************************************* #include #include #include #include #include #include #include //include my own header file #include "lab_14_head.h" using namespace std; int main( ) { /*************************************************************** Part A. Practice ***************************************************************/ //variable declaration int number1, number2, result; //vars to store two int values int flag; //for option selection //call showMenu() to show the menu showMenu(); //get option cout<<" Enter your choice => "; cin>>flag; //four case selection using switch switch(flag) { case 1: //call fun_1() cout<<" Calling fun_1() ......................... "< "; cin>>number1>>number2; //function calling fun_2(number1, number2); //see parameter passing cout<<" End of calling fun_2()" < "; cin>>number1>>number2; //function calling result = fun_4(number1, number2); //see parameter passing and value receiving cout<<" The sum is " << result <