Question: Write a C++ that has a function to find out how close a number is to another given the whole range of numbers. For example:
Write a C++ that has a function to find out how close a number is to another given the whole range of numbers.
For example:
![]() | Alpha is close to Beta |
![]() | Alpha is not that close to Beta |
![]() | Alpha is far from Beta |
The idea is to make a function named: numbersTemperature that will return:
-2 if the numbers are very far from each other, Frozen
-1 if the numbers are far from each other, Cold
0 if the numbers are equal (alpha and beta)
1 if the numbers are close to each other, Warm
2 if the numbers are very close to each other, Hot
You will need to figure out how to quantitatively express "very far", "far", "close", "very close" using the information that the function is receiving: min, max, alpha and beta.
Assume all numbers are integer.
Write the C++ program that tests the function, and explain in commentaries how you solved the "distance"/"temperature" issue.
alpha min max beta
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts



