Question: QUESTION 22 Write a function that accepts a value and returns the number rounded to the nth decimal place (Note. The function returns the rounded

 QUESTION 22 Write a function that accepts a value and returns

QUESTION 22 Write a function that accepts a value and returns the number rounded to the nth decimal place (Note. The function returns the rounded value and takes two arguments: the number to round and the desired nth decimal place) In order to round a number to the nth decimal place use the following steps 1. Multiply the number by 10n 2. Add 0.5 3. Delete the fractional part of the result 4. Divide by 10 For example, using these steps to round 78.374625 to three decimal places: 1. 78.374625 x 103 78374 625 2. 78374.625+0.5 78375.125 3. 78375 4. 78375/103 78.375 Use this function in a program that accepts a user-entered value and displays the number rounded to a user-entered decimal place Add a comment with your name, course code and date to the program. Provide the cpp file along with a screenshot with sample values together in a zip file. Attach File Browse My ComputerBrowse Content Collection Browse D

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 Databases Questions!