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, 03.07.2019 23:20
Two technicians are discussing the intake air temperature (iat) sensor. technician a says that the computer uses the iat sensor as a backup to the engine coolant temperature (ect) sensor. technician b says that the powertrain control module (pcm) will subtract the calculated amount of fuel if the air measures hot. who is correct
Answers: 3
question
Engineering, 04.07.2019 18:10
Acompressor receives the shaft work to decrease the pressure of the fluid. a)- true b)- false
Answers: 3
question
Engineering, 04.07.2019 18:10
Afour cylinder four-stroke in-line engine has a stroke of 160mm, connecting rod length of 150mm, a reciprocating mass of 3kg and its firing order is 1-3-4-2. the spacing between cylinders is 100mm. i. show that the engine is in balance with regard to the primary inertia forces and primary 3. a and secondary inertia couples. li determine the out of balance secondary inertia force ii. propose ways of balancing this out of balance force and discuss the challenges that will arise
Answers: 3
question
Engineering, 04.07.2019 18:20
Avolume of 2.65 m3 of air in a rigid, insulated container fitted with a paddle wheel is initially at 264 k, 5.6 bar. the air receives 432 kj by work from the paddle wheel. assuming the ideal gas model with cv = 0.71 kj/kg • k, determine for the air the amount of entropy produced, in kj/k
Answers: 2
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, 16.10.2020 20:01
question
Mathematics, 16.10.2020 20:01
question
Mathematics, 16.10.2020 20:01
question
Chemistry, 16.10.2020 20:01
Questions on the website: 13722366