Question: Problem 3. [20 points] Implement Banker's rounding algorithm: (1) ask the user to enter a number. (2) if the fraction is less than 0.5, round

 Problem 3. [20 points] Implement Banker's rounding algorithm: (1) ask the

Problem 3. [20 points] Implement Banker's rounding algorithm: (1) ask the user to enter a number. (2) if the fraction is less than 0.5, round down; if the fraction is greater than 0.5, round up; if the fraction is equal to 0.5, round to the nearest even number (3) display the rounded number on the screen. Please testing the following four numbers 0.4, 0.6, 0.5, 1.5 as input and report what are the output in your write up

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