Hello,
I have an assignment due tomorrow that I've been trying to debug for a week. Google has failed me horribly at finding out what's going on.
The problem is to "use functional decomposition to write a C++ program that determines the median of three input numbers..."
So far the program that I've made will do this, but only with whole numbers. If I enter the floating point values that are supposed to be used I get nothing.
This is in the chapter for conditions, logical expressions, and selection control structures, just to let you know where I am.
Here's a snippet of my code. My declared floating point variables are num1, num2, and num3. The numbers are entered by the user via cin.
I used to have that statement wrapped up with an || operator, but started breaking it down to see if that would work.
I have an assignment due tomorrow that I've been trying to debug for a week. Google has failed me horribly at finding out what's going on.
The problem is to "use functional decomposition to write a C++ program that determines the median of three input numbers..."
So far the program that I've made will do this, but only with whole numbers. If I enter the floating point values that are supposed to be used I get nothing.
This is in the chapter for conditions, logical expressions, and selection control structures, just to let you know where I am.
Here's a snippet of my code. My declared floating point variables are num1, num2, and num3. The numbers are entered by the user via cin.
Code:
if(num1 < num2 && num1 > num3) cout << num1 << " is the median number." << endl; else if(num1 > num3 && num1 < num2) cout << num1 << " is the median number." << endl;
Comment