Question
use a function called figureIt that determines some attributes of a floating-point number: 1) Is it evenly divisible by 2 - a Boolean 2) What
use a function called figureIt that determines some attributes of a floating-point number: 1) Is it evenly divisible by 2 - a Boolean 2) What is its sign - a character, and 3) What is its integer part rounded up or down as appropriate, an integer. Since the function has to "return" these three values, it can't use a return statement to do this. Return statements can only return one thing. Therefore, the function will have to "return" these three values using reference variables. The function has a total of four parameters and a post-condition that three of the actual parameters are changed by the function. The function figureIt does not have any I/O in it. Write a driver (a main function) that asks the user over and over for a real number until the user enters 0, determines its properties by calling the figureIt function, and prints these properties out. There is a round function - don't use it.
The ex[ected output is Enter x: 2
2: even, +, 2
Step 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