Assume that type Money, a structured type with two int fields, dollars and cents, has been declared . Write the definition of a function named normalize that receives a Money argument and returns a Money value. What it returns is the “normalized” equivalent of the argument, that is, a value that is equivalent but where cents is a number between 0 and 99 inclusive. So if a Money value of 5 dollars and 325 cents was passed, a Money value of 8 dollars and 25 cents would be returned.
LANGUAGE: C++
CHALLENGE:
Assume that type Money, a structured type with two int fields, dollars and cents, has been declared . Write the definition of a function named normalize that receives a Money argument and returns a Money value. What it returns is the “normalized” equivalent of the argument, that is, a value that is equivalent but where cents is a number between 0 and 99 inclusive. So if a Money value of 5 dollars and 325 cents was passed, a Money value of 8 dollars and 25 cents would be returned.
SOLUTION:
The Bad News: The content you are trying to access is only available to members.
The Good News: You too can be a member, simply Click Here.
Already a member? Log In Here
Posted in C++, Learn To Code