Question: 2a) You are to write a rounding function for a financial app that rounds off real numbers to have only 2 decimal places (dollars and

 2a) You are to write a rounding function for a financial

2a) You are to write a rounding function for a financial app that rounds off real numbers to have only 2 decimal places (dollars and cents). Calculate the roundoff error for two different rounding strate- gies. Hint: in C/C+ use function floorf, roundf and ceilf for different roundoff strategies 2b) Generalize your roundoff function from above (instead of 2 use n) and use it to solve the following system of simultaneous equations using different number of significant digits such that x and y should 0.10362 + 0.2 122y = 0.7381 0.2081 r + 04247y = 0.9327 Compare the roundoff errors for the two different strategies used and comment on your results 2a) You are to write a rounding function for a financial app that rounds off real numbers to have only 2 decimal places (dollars and cents). Calculate the roundoff error for two different rounding strate- gies. Hint: in C/C+ use function floorf, roundf and ceilf for different roundoff strategies 2b) Generalize your roundoff function from above (instead of 2 use n) and use it to solve the following system of simultaneous equations using different number of significant digits such that x and y should 0.10362 + 0.2 122y = 0.7381 0.2081 r + 04247y = 0.9327 Compare the roundoff errors for the two different strategies used and comment on your results

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!