Question: 5 . 1 8 LAB: Write SumAndCast ( ) function to cast double to int 5 . 1 8 LAB: Write SumAndCast ( ) function

5.18 LAB: Write SumAndCast() function to cast double to int 5.18 LAB: Write SumAndCast() function to cast double to int
LAB
5.18.1: LAB: Write SumAndCast() function to cast double to int
Complete the SumAndCast() function that casts the parameters from doubles to integers and returns the resulting sum.
Note that the main() function prints out the returned value of the SumAndCast() function.
Ex: If the double values are 14.2 and 19.9, then the output is:
33
Ex: If the double values are 2.5 and 3.1, then the output is:
5
main.cpp
#include
LAB
5.18.1: LAB: Write SumAndCast() function to cast double to int
Complete the SumAndCast() function that casts the parameters from doubles to integers and returns the resulting sum.
Note that the main() function prints out the returned value of the SumAndCast() function.
Ex: If the double values are 14.2 and 19.9, then the output is:
33
Ex: If the double values are 2.5 and 3.1, then the output is:
5
main.cpp
#include
5 . 1 8 LAB: Write SumAndCast ( ) function to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!