
George M. answered 06/23/21
Software Engineer with BS in Computer and Software Engineering
Hi Maggie!
Did this question happen to specify a language that this should be implemented in? That will determine the actual implementation.
Regardless, the general idea is that this question is printing an integer and a double to the console. Each language has a print function which can accomplish this. Some languages, such as Python will take care of the formatting of integers and doubles itself, while a language like C will need a format string to determine which one is an integer and which is a double.
For Python, you can just use the print function.
In C, you would need to specify the types of iVal and fVal in the printf statement.
In this case "%i" represents an integer and "%g" represents a float with the trailing zeros suppressed. Using "%f" instead would result in "i=5 f=2.400000".