Question: 1. Write C++ function called changeToUpper that will take pne parameter of type char and use pass by reference to modify the passed value into
1. Write C++ function called changeToUpper that will take pne parameter of type char and use pass by reference to modify the passed value into an uppercase character. The function should not return anything. Your main function should print the value of char variable before and after the call to changeToUpper function so one can check if your function works correctly. (hint the standard library function toUpper() converts character to uppercase, to use this function you need to include cctype header.)
2. Write C++ function called normalize that will take one integer parameter and use pass by reference to modify the parameter value in the following way: if the value is negative it should be set to -1, if the value is positive it should be set to 1 and if the value is 0 it should stay 0. the function should not return anything. In main function print the value of the integer variable before and after the invication of normalize function so one can see if your function works correctly.
Step by Step Solution
There are 3 Steps involved in it
Lets tackle each part step by step Part 1 changeToUpper Function Step 1 Function Definition We need a function changeToUpper where the parameter is pa... View full answer
Get step-by-step solutions from verified subject matter experts
