Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Digital Logic Floating Point to Hexadecimal Converter Exercise The purpose of this exercise to learn how to convert a floating point number to a hexadecimal
Digital Logic Floating Point to Hexadecimal Converter Exercise The purpose of this exercise to learn how to convert a floating point number to a hexadecimal (base 16) number Instructions: Write a complete C++ program that will allow the user to convert a sequence of floating point numbers into hexadecimal numbers. The hexadecimal number will be stored in a vector of characters. System Requirements: 1. The main function will use a loop to do the following a. Input a floating point number from the console screen. b. Call a function entitled Float_To_Hex. This function will take a floating point number in as a parameter. The function will return a vector of characters. This vector will contain the characters that make up the hex number. Example: 757.25-'2','F,5',,'4 Call the function: Display_1D_Vector. This function will take in a vector of characters as a parameter. The function will output every character that exists in the vector. c. Note: The main function's loop will end when the user does not input a 'Y or 'y to indicate that they want to continue. You can assume that the user will always input valid floating point numbers to convert. 2. The Float_To_Hex function should work for any valid non-negative floating point number. Each element of the vector that is returned will contain either a'or exactly 1 digit in the hex number. If there are no significant digits to the right of the decimal place, the rightmost digit will contain a 'o A sample run exists on the following page: Input a floating point number: 18.26 Hexadecimal Equivalent 12.428F6 D you want t continue (Y/y)? y Input a floating point number 757.25 Hexadecimal Equivalent 2FS. 4 Do you want (Y/y)? y to cont inue Input a floating point number 123. 17 Hexadecimal Equivalent 7B. 2B85 Do you want to cont inue (Yy)? Y Input a f loat ing Pint number16 Hexadecimal Equivalent: 10 Do you want to Press any key to cont inue .. . continue (Y/y)? N
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started