GSP 115 Week 1 Homework

Published on January 2018 | Categories: Graphic Art | Downloads: 187 | Comments: 0 | Views: 1438
of 1
Download PDF   Embed   Report

1. Compile Time Bugs (TCO 4) 2. Numbers and Conversions (TCO 4) Questions 1. When storing a floating point number into an integer variable, does it truncate or round? The value truncates. 2. When the floating point numbers were printed out at higher precision, they were not the same value as entered. Research this issue and explain why . 3. The setprecision(12) command either sets the precision for 12 places after the decimal point or 12 digits total; select the right option for each case below. a. fixed [after the decimal point] b. scientific [after the decimal point] c. float [after the decimal point] 4. Based on the results of taking the square root and then squaring again, what would you say about the accuracy of floating point arithmetic in C++? Floating point arithmetic seems to be very inaccurate, which is worsened as the values are manipulated. 5. Dividing by zero in earlier compilers generates an error and an exception. What does Visual Studio 2012 produce as the result of dividing by zero? Warning warning C4723: potential divide by 0 3. Create a Program From Pseudocode (TCO 1)

Comments

Content

1. Compile Time Bugs (TCO 4) 2. Numbers and Conversions (TCO 4) Questions 1. When storing a floating point number into an integer variable, does it truncate or round? The value truncates. 2. When the floating point numbers were printed out at higher precision, they were not the same value as entered. Research this issue and explain why . 3. The setprecision(12) command either sets the precision for 12 places after the decimal point or 12 digits total; select the right option for each case below. a. fixed [after the decimal point] b. scientific [after the decimal point] c. float [after the decimal point] 4. Based on the results of taking the square root and then squaring again, what would you say about the accuracy of floating point arithmetic in C++? Floating point arithmetic seems to be very inaccurate, which is worsened as the values are manipulated. 5. Dividing by zero in earlier compilers generates an error and an exception. What does Visual Studio 2012 produce as the result of dividing by zero? Warning warning C4723: potential divide by 0 3. Create a Program From Pseudocode (TCO 1)

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close