Question: in C++ run the example this is a main that systematically calls each of the functions that are part of this assignemnt. It call each
in C++
run the example this is a main that systematically calls each of the functions that are part of this assignemnt. It call each function several times with different parameter values. It then test that the function correctly accomplished the task it was to do. Put your functions prototypes (declarations) in "functions.h" and the function bodies in "functions.cpp" a Makefile, main1.cpp, functions.h and functions.cpp have been provided for you in "main1.cpp" you will test call all your functions to make sure they work properly is is 100% your responsibility to make sure that the 4 functions you write work properly All you code should be 100% your own work, there is no reason at all why your main.cpp should look like any other, the job of the main is NOT to try to look like the example test all of your functions with different values to make sure they work and to give you experience calling them do not prompt user to enter values to test your functions, that is a good way to test them initially, however I want it do display "Pass" or "Fail" for each test of each function... you can have multiple output statements per function THERE is an example of testing a function in the examples section at examples named sample_main_to_test_a_function.cpp write the bodies for the function prototypes in your functions.cpp File: functions.h
#pragma once #include "cmpslib19.h" // all the special functions provided for this class #include "easylogging++.h" // PUT THE COMPLETE FUNCTIONS in functions.cpp // ONLY the functions headers (prototype) here //DO NOT use the same function name for multiple functions //when you test your functions it must be clear which function you are testing //overloading a function name will be ambiguous so for this assignment DO NOT do it //DO NOT return anything other than void unless it is absolutely necessary //DO NOT use pass by refference or pass by pointer for ANY parameters that do not need to change //unless you make them const //the pass by value function is the only one that does not return void //Create 3 functions that will triple an int value //each of the functions will have one parameter, the integer to triple //one function will be PBV, one function will be PBP and one function will be PBR //PBV returns int , others return void int TripleInt1 ( const int ); void TripleInt2 ( int * ); void TripleInt3 ( int & ); //create two functions that will allow a user to swap two integer values //one function will have two PBR parameters and //one function will have two PBP parameters //both functions return void void SwapInt1 (int *,int *); void SwapInt2 (int &,int &); //create 3 functions that can be used to determine the larger of 2 integer values //one function will be PBV and return the result //the other two functions will have 3 parameters, the result ( the larger of parameter one and two ) will be stored in the third //parameter, in one function the third parameter will be PBR and on the other PBP //PBV returns int , others return void int Larger1( int, int ); void Larger2( int, int,int * ); void Larger3( int, int,int & );
This is what the output below is supposed to be I am getting a different output
Testing TripleInt pbv Pass Pass Pass Pass Pass Testing TripleInt pbp Pass Pass Pass Pass Testing TripleInt pbr Pass Pass Pass Pass
test SwapInt pbp Pass Pass Pass Pass test SwapInt pbr Pass Pass Pass Pass
test Larger pbv Pass Pass Pass Pass test Larger pbr Pass Pass Pass test Larger pbp Pass Pass Pass
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
