Question: I cannot get my program to replace the currentMax and currentMin variables with the highest and lowest user-entered values (called userValue), respectively. I am not

I cannot get my program to replace the currentMax and currentMin variables with the highest and lowest user-entered values (called userValue), respectively. I am not even 100% sure it is checking the userValue variable for every integer entered by the user.

Thank you in advance!

I cannot get my program to replace the currentMax and currentMin variables

Here is the code I wrote that I am struggling to correct.

with the highest and lowest user-entered values (called userValue), respectively. I am

not even 100% sure it is checking the userValue variable for every

Example of current output:

integer entered by the user. Thank you in advance! Here is the

Question 3 Use two functions, [return type] highest (currentMax, input) current Max needs to be set to -inf initially [currentMax = INT_MIN] [return type] lowest (currentMin, input) currentMin needs to be set to inf initially [currentMin = INT_MAX] Write a program that prompts users for N integers and determines then displays the integer with the highest/lowest value. #include using namespace std; int highest(int& currentMax, int n); 10 11 12 13 14 15 16 17 18 19 20 21 22 23 int lowest(int& currentMin, int n); 0; Dint main() { int n int userValue = 0; int currentMax = INT_MAX; int currentMin = INT_MIN; 24 25 26 27 28 29 cout > n; cout > userValue; cout currentMax) { currentMax = n; } return currentMax; 59 Qint lowest(int& currentMin, int n) 60 61 if (n

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!