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 betaStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started