Math233 Math 233 Math/233 - Week 7 - Lab 7 - Write a program that will explore Data Storage Limits in C++ (TCO 3)
    Math233 Math 233 Math/233 - Week 7 - Lab 7 - Write a program that will explore Data Storage Limits in C++ (TCO 3)

Math233 Math 233 Math/233 - Week 7 - Lab 7 - Write a program that will explore Data Storage Limits in C++ (TCO 3)

$19.99

Write a program that will explore Data Storage Limits in C++ (TCO 3). Your program should perform all of the below calculations and provide the desired output.  Make sure to format your output to show a sufficent number of digits of precision. 

Deliverables

For credit, your program must at least compile and run properly. It should also contain adequate comments such as:

  • Basic introductory comments including a brief description, date, and author.
  • Descriptions of each variable.
  • Description of significant procedures.

Each student must write and submit his or her own code for the assignment. Discussion of the assignment is allowed. You may share ideas but not code files.

Also include, in comments in your program, a discussion of what you see (and why), when you run this program (there should be some unexpected results).

Sample Output (no user input required):

INT_MIN=-2147483648
INT_MIN SQUARED=0

Squaring powers of 10, storing in INT (32 bit)
10 squared = 100
100 squared = 10000
1000 squared = 1000000
10000 squared = 100000000
100000 squared = -2147483648

FLT_MAX=3.4028234663852886e+038
FLT_MAX DOUBLED=1.#INF000000000000e+000

FLT_MIN=1.1754943508222875e-038
FLT_MIN DIVIDED BY 10 =1.1754946310819804e-039

DBL_EPSILON=2.2204460492503131e-016
((2+DBL_EPSILON)+DBL_EPSILON)=2.0000000000000000e+000
(2+(DBL_EPSILON+DBL_EPSILON))=2.0000000000000004e+000

.2 summed 100 times =1.9999999999999961e+001
.2 summed 10000 times =2.0000000000003176e+003

LAB STEPS

STEP 1: (Unsigned) Integer Calculations (10 points)

  1. Locate the smallest (negative) integer, INT_MIN, and print it. Then square INT_MIN and print the output.
  2. Find the smallest power of 10 that when squared in C++ gives the wrong value. Present output that indicates the power chosen and the incorrect result that C++ calculates.

 STEP 2: (Single-Precision) Floating Point Calculations (20 points)

  1.  Find the largest real value, FLT_MAX, and print it. Then double FLT_MAX and print the resulting value.
  2. Find the smallest positive real value, FLT_MIN, and print it. Then divide FLT_MIN by 10 and print the resulting value.
  3. (v) If e represents double-precision machine epsilon for C++ (DBL_EPSILON), calculate 2 + e + e first by adding the numbers (using a computer) from left to right and then from right to left.
  4. (vi) Sum (DO NOT MULTIPLY) repeated copies of 0.2:
  • 100 times and print the output to as many digits as possible. Does it equal 20.0?
  • 10,000 times and print the output to as many digits as possible. Does it equal 2000.0?

Here is a list of helpful include files:
#include <iostream>
#include <iomanip>
#include <math.h>
#include <float.h>

 

My tutorial contain Visual C++ project.

Please using Visual Studio to open this project.

Thank you for purchase my tutorial.

If you have more question or need help, please contact me via email support@extutorials.com. I will help you any time.
.

Attached Files

Move over [ preview ] file name to preview content in it!

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



PURCHASE SAVE
2 Tutorials 10%
3 Tutorials 13%
4 Tutorials 16%
5 Tutorials 19%
6 Tutorials 22%
7 Tutorials 25%
8 Tutorials 28%
9 Tutorials 31%
10 Tutorials 34%
add url more

9MZQASHWN73B