Question: An app of method Math.Floor is rounding a value to the nearest integer. The statement y = Math.Floor( x + 0.5 ); will round the

An app of method Math.Floor is rounding a value to the nearest integer. The statement

y = Math.Floor( x + 0.5 );

will round the number x to the nearest integer and assign the result to y. Write an app that reads double values and uses the preceding statement to round each of the numbers to the nearest integer. For each number processed, display both the original number and the rounded number.

Step by Step Solution

3.58 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To create a simple app that reads double values rounds them to the nearest integer using MathFloor and then displays both the original and rounded val... View full answer

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

Document Format (2 attachments)

PDF file Icon

60618495a8c66_55260.pdf

180 KBs PDF File

Word file Icon

60618495a8c66_55260.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!