Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that reads in two floating-point numbers and tests (a) whether they are the same when rounded to three decimal places and (b)

image text in transcribed

Write a program that reads in two floating-point numbers and tests (a) whether they are the same when rounded to three decimal places and (b) whether they differ by less than 0.001. Sample Inputs (in Red) /Outputs: Sample 1: Enter two double numbers: 1.00.99998 They are the same when rounded to three decimal places. They differ by less than 0.001. Sample 2: Enter two double numbers: 0.99910.999999 They are different when rounded to two decimal places. They differ by less than 0.001. Sample 3: Enter two double numbers: 0.98760.93212 They are different when rounded to two decimal places. They differ by greater than 0.001

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions

Question

What is C LANGUAGE ? Why Learn C LANGUAGE?

Answered: 1 week ago

Question

5. How would you describe your typical day at work?

Answered: 1 week ago

Question

7. What qualities do you see as necessary for your line of work?

Answered: 1 week ago