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:

Write a C++ that has a function to find out how close Alpha is close to Beta
a number is to another given the whole range of numbers. For Alpha is not that close to Beta
example: Alpha is close to Beta Alpha is not that close to 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

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!