Given a double precision floating point number with a decimal point, write a function named prg_question_3 to return the whole number and decimal part of the number as a std::pair object of integers with first part being the whole number part and the second part being the fraction or decimal part. For example given the number 3.14, the "first" part of the pair object must be 3 and the "second" must be 14. Do the following: 1. Follow UMPIRE process to get the algorithm. Write only the algorithm as code comments 2. Implement your function( 3. Test your function for numbers 3.14159 and 2.71828. Please follow the test criteria given in the code template
Given a double precision floating point number with a decimal point, write a function named prg_question_3 to return the whole number and decimal part of the number as a std::pair object of integers with first part being the whole number part and the second part being the fraction or decimal part. For example given the number 3.14, the "first" part of the pair object must be 3 and the "second" must be 14. Do the following: 1. Follow UMPIRE process to get the algorithm. Write only the algorithm as code comments 2. Implement your function( 3. Test your function for numbers 3.14159 and 2.71828. Please follow the test criteria given in the code template
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 2 images