Write a program in VS C++ 2017 to convert a signed floating-point number to its binary...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program in VS C++ 2017 to convert a signed floating-point number to its binary equivalent using the 14-bit format shown in class. To make your life easier, your program should first read in the integral part (including the sign if negative) and the fractional part for the floating-point number to be converted. Your program then does the necessary conversion and displays the result to the screen. The following shows a scenario of running a sample program, where user's inputs are represented in boldface. Enter the integral part of the floating-point number: -17 Enter the fractional part of the floating-point number: 23 The binary equivalent of the floating-point number is 11001100010011 More conversion (y or n): y Enter the integral part of the floating-point number: 0 Enter the fractional part of the floating-point number: 03125 The binary equivalent of the floating-point number is 00101000000000 More conversion (y or n): n Good bye! Note that excess-15 should be used to produce a biased exponent for each of the floating- point numbers to be converted. Note also that the 0 in the fractional part of the second example shown above cannot be omitted. Write a program in VS C++ 2017 to convert a signed floating-point number to its binary equivalent using the 14-bit format shown in class. To make your life easier, your program should first read in the integral part (including the sign if negative) and the fractional part for the floating-point number to be converted. Your program then does the necessary conversion and displays the result to the screen. The following shows a scenario of running a sample program, where user's inputs are represented in boldface. Enter the integral part of the floating-point number: -17 Enter the fractional part of the floating-point number: 23 The binary equivalent of the floating-point number is 11001100010011 More conversion (y or n): y Enter the integral part of the floating-point number: 0 Enter the fractional part of the floating-point number: 03125 The binary equivalent of the floating-point number is 00101000000000 More conversion (y or n): n Good bye! Note that excess-15 should be used to produce a biased exponent for each of the floating- point numbers to be converted. Note also that the 0 in the fractional part of the second example shown above cannot be omitted.
Expert Answer:
Answer rating: 100% (QA)
Heres a C program that fulfills your requirements include iostream include cmath using namespace std ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Either: Prove that k-means will produce k clusters, allnonempty, OR: Give anexample of a set D of data points (with no repeated data point), avalue for k(k
-
Refer to the exponential model given in Problem 16.42. a. What is the fitted value of the series in the fourth quarter of 2011? b. What is the fitted value of the series in the first quarter of 2011?...
-
A heat engine using a diatomic gas follows the cycle shown in FIGURE P21.56. Its temperature at point 1 is 20°C. a. Determine W s , Q, and ÎE th for each of the three processes in this...
-
In general how have interest rates changed since the late 1980s according to Figure 11.1? FIGURE 11.1 Interest and Inflation Rates, 1988-2010 10p Rate (%) 8 6 10-Year Treasury Bonds 4 2 AAA Corporate...
-
World Gourmet Coffee Company (WGCC) is a distributor and processor of different blends of coffee. The company buys coffee beans from around the world and roasts, blends, and packages them for resale....
-
Share any experience you have with a database accessed for work or pleasure. What database management system was used for the database? Did you like the database? Why or why not? Or, share a link to...
-
The work W (in foot-pounds) done in compressing a volume of 9 cubic feet at a pressure of 10 pounds per square inch to a volume of 3 cubic feet is W = 12,960(ln 9 - ln 3). Find W. (Round your answer...
-
There are four types of innovation in the markets and technologies framework. Which of the four types is the most preferred? Why is it the most preferred? Short Answer Toolbar navigation B IUS A V V
-
5. An NBA regulation court has a free throw line 15 ft away from the basket. The basketball hoop is 10 ft above the floor. The half court is 43 ft away from the basket. Steph Curry is about 6.15 ft...
-
use the prime factorization of a and b (1) to decide whether a | b, (2) to compute (a, b), and (3) to compute [a, b]. 15. a 495, b = 3861 = 17. a 266, b = 748 19. a 2090, b = 1911 = 16. a= 4600, b =...
-
The weight of each Golden Dairys Probiotic Yogurt with Fruitcup is normally distributed with a mean of 170 grams and a standarddeviation of 12 grams. One package contains six random cups and...
-
Noah and Joan Arc live with their family in Dayton, OH. Noahs Social Security number is 434-11-3311. Noah was born on February 22, 1983, and Joan was born on July 1, 1984. Both enjoy good health and...
-
Ashlee, Hiroki, Kate, and Albee LLC each own a 25 percent interest in Tally Industries LLC, which generates annual gross receipts of over $10 million. Ashlee, Hiroki, and Kate manage the business,...
-
Define x as a symbolic variable and create the two symbolic expressions S1 = x2(x - 6) + 4(3x - 2) and S2 = (x + 2)2 - 8x Use symbolic operations to determine the simplest form of each of following...
-
739 apples are to be packed and shipped such that 54 are placed in a box. By typing one line (command) in the Command Window, calculate how many apples will remain unpacked if only full boxes can be...
-
Write a MATLAB program in a script file that calculate the average, standard deviation, and median of a list of grades as well as the number of grades on the list. The program asks the user (input...
-
Explain how budgeting helps in running a business efficiently and effectively.
-
The best way to conduct performance evaluation is to determine broad business goals and prepare a financial plan in which senior management is responsible for the whole business. Discuss.
-
Read the following and answer the questions below. The costs of hosting the Olympic Games During Olympic years there is a tangible sense of anticipation for many people who enjoy watching or...
Study smarter with the SolutionInn App