subject
Engineering, 16.07.2020 22:01 Poohlobster

Write a C++ program that displays in exact number the smallest and the largest number of trees per square miles in a region. In order to do this, you will ask the user to first input a number to tell the program which one of the following combinations they will use for the two values that they will enter, use choice:. 1) when both the smallest and the largest numbers are integers
2) when the smallest number is an integer and the largest number is a float
3) when the smallest number is a float and the largest number is an integer
4) when both numbers are float
Any other option is invalid, display a message, and terminate the program
Here are the four scenarios you may face depending on the choice that is made previously:.
1) If both numbers are integers, then you simply call a function to display them as they were entered.
2) If the first number, the smallest number, was entered with decimal point, you want to round the number down, then display both values
3) If the second number, the largest number, was entered with decimal point, you want to round that up, then display the both values.
4) If both the smallest and largest numbers were entered with decimal, then you want to round the first one down and the second one up, then display the values.
You are required to use function name overloading to write 4 functions that take care of each one of the four scenarios.

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:20
Wiy doeres rere okhn a pump whon working betwon the same pressure range?
Answers: 2
question
Engineering, 04.07.2019 19:10
The short distance from the objective lens to the object causes problems at high magnification. which of the following is the most serious? a. cleaning the object surface b. positioning the object c. reflection from the object surface. d. illumination of the object
Answers: 1
question
Engineering, 06.07.2019 02:30
A12 mm diameter shaft runs in a plain cylindrical bush 30 mm long that is located in an 18 mm diameter hole in a housing. the shaft-inner bush fit is h8 f and the outer bush-housing fit is h7-p6. make a fully cimensioned sketch of the bush with tolerances. find the maximum and minimum clearance or interference for both fits on the inner and outer diameters of the bush
Answers: 3
question
Engineering, 06.07.2019 04:30
Mention two examples each of the direct and indirect measurement of force.
Answers: 3
You know the right answer?
Write a C++ program that displays in exact number the smallest and the largest number of trees per s...
Questions
question
Mathematics, 27.03.2021 16:20
question
Mathematics, 27.03.2021 16:20
question
Mathematics, 27.03.2021 16:20
question
Mathematics, 27.03.2021 16:20
Questions on the website: 13722362