Related questions with answers


a. Write a C++ function named fracpart () that returns the fractional part of any number passed to the function. For example, if the number 256.879 is passed to fracpart (), the number 879 should be returned. Have the fracpart () function call the whole () function you wrote in previous Exercise. The number returned can then be determined as the number passed to fracpart () less the returned value when the same argument is passed to whole(). b. Include the function written in previous Exercise in a working program. Make sure the function is called from main() and correctly returns a value to main (). Have main() use a cout statement to display the returned value. Test the function by passing various data to it. c. When you're confident the fracpart () function written for previous Exercise works correctly, save it in the same namespace and personal library selected for previous Exercise.


Answered 2 years ago
Answered 2 years ago
Step 1
1 of 3

Create an account to view solutions

Create an account to view solutions

More related questions