Question: Define a function CalculateVal ( ) that has one double parameter and returns the parameter minus 5 . 9 if the parameter is less than

Define a function CalculateVal() that has one double parameter and returns the parameter minus 5.9 if the parameter is less than 8.0. Otherwise, CalculateVal() returns the parameter plus 5.9.
Click here for examples
Ex 1: If the input is 2.7, then the output is:
-3.20
Ex 2: If the input is 9.5, then the output is:
15.40
1234567891011121314151617
#include #include using namespace std;/* Your code goes here */int main(){ double valueRead; double result; cin >> valueRead; result = CalculateVal(valueRead); cout << fixed << setprecision(2)<< result << endl; return 0;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!