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 15:10
Heat is added to a piston-cylinder device filled with 2 kg of air to raise its temperature 400 c from an initial temperature of t1 27 cand pressure of pi 1 mpa. the process is isobaric process. find a)-the final pressure p2 b)-the heat transfer to the air.
Answers: 1
question
Engineering, 04.07.2019 18:10
Thermal stresses are developed in a metal when its a) initial temperature is changed b) final temperature is changed c) density is changed d) thermal deformation is prevented e) expansion is prevented f) contraction is prevented
Answers: 2
question
Engineering, 04.07.2019 18:10
Which of the following ziegler nichols tuning methods the response of the controller to a step input should exhibit an s-shaped curve? a)-open loop mode b)-closed loop mode c)-both modes (open & closed) d)-none of the modes (open & closed)
Answers: 3
question
Engineering, 04.07.2019 18:10
Which one from below is not one of the reasons of planning failures? (clo3) a)-planner is careless. b-planner spend less time in the field but more time on the desk c)-planner is not qualified d)-planner does not have sufficient time to properly plan
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, 04.04.2021 14:00
question
Business, 04.04.2021 14:00
question
Mathematics, 04.04.2021 14:00
question
Mathematics, 04.04.2021 14:00
question
Mathematics, 04.04.2021 14:00
Questions on the website: 13722360