Question: Write a program that performs the following tasks. Command line flags should be used to determine which option to run. See man getopt _ longLinks

Write a program that performs the following tasks. Command line flags should be used to determine which option to run. See man getopt_longLinks to an external site. for details on how to do this. All floating point formats are IEEE 754 unless otherwise noted.
Read in a hex value, and interpret it as a single precision floating point value. (--hex-float, -x)
Read in a hex value, and interpret it as a double precision floating point value. (--hex-double, -X)
Read in a floating point value, and return the hex representation of it in single precision. (--float-hex, -f)
Read in a floating point value, and return the hex representation of it in double precision (--float-double, -d)
Read in a double precision floating point value, and print the following interpretations of the bit pattern (--print, -p):
A string of characters2 consecutive floating point valuesThe hex representation of the value232-bit signed integers
little-endianbig-endian
232-bit unsigned integers
little-endianbig-endian
164-bit signed integer
little-endianbig-endian
164-bit unsigned integer
little-endianbig-endian
Your program must have a --help option which shows usage.

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!