C++  Have the user input a Float (ex: -15.750) and the output must display the following: Float Number (what the user inputted), Sign (If the user inputted a positive or negative Float), Whole (binary), Fractional, Exponent, Mantissa and IEE 754.  NO library functions like atoi.  These are the steps that I have so far:  Input a Float Check if Float is Pos or Neg -> store 0 or 1 (and then make it positive to make it easier) Split the float into whole (int) and fractional (float) Convert whole number into binary (if whole == 0) like (0.1231), then just store 0 into the binary Convert fractional to binary Find exponent bias Convert exponent bias to binary Create the mantissa Create IEE754 (the whole thing) OUTPUT:  Float Number:  Sign:  Whole (Binary):  Fractional:  Exponent:  Mantissa: IEE 754:

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 1TF: Mark the following statements as true or false: a. To use a predefined function in a program, you...
icon
Related questions
Question

C++ 

Have the user input a Float (ex: -15.750) and the output must display the following: Float Number (what the user inputted), Sign (If the user inputted a positive or negative Float), Whole (binary), Fractional, Exponent, Mantissa and IEE 754. 

NO library functions like atoi. 

These are the steps that I have so far: 

Input a Float

Check if Float is Pos or Neg -> store 0 or 1 (and then make it positive to make it easier)

Split the float into whole (int) and fractional (float)

Convert whole number into binary

(if whole == 0) like (0.1231), then just store 0 into the binary

Convert fractional to binary

Find exponent bias

Convert exponent bias to binary

Create the mantissa

Create IEE754 (the whole thing)

OUTPUT: 

Float Number: 

Sign: 

Whole (Binary): 

Fractional: 

Exponent: 

Mantissa:

IEE 754: 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,