Your task is to write program that takes a hexadecimal bit-pattern and prints the decimal fractional...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Your task is to write program that takes a hexadecimal bit-pattern and prints the decimal fractional value of the number. Input-Output format: Your program will take one file name as its command-line input. Each line in the input file will have the total number of bits, the number of bits for the exponent, number of bits for the fraction, the hexadecimal bit-pattern, and the number of precision bits after the decimal point in the decimal fraction. These numbers on a given line are separated by a space. For each line in the input, you should print out the decimal fraction value with the specified number of precision bits followed by a new line. Example Execution: Let's assume we have the following input file: input.txt 843 0x4d 2 8 4 3 0x16 7 Then the result will be: $./first input.text 6.50 .0546875 Your task is to write program that takes a hexadecimal bit-pattern and prints the decimal fractional value of the number. Input-Output format: Your program will take one file name as its command-line input. Each line in the input file will have the total number of bits, the number of bits for the exponent, number of bits for the fraction, the hexadecimal bit-pattern, and the number of precision bits after the decimal point in the decimal fraction. These numbers on a given line are separated by a space. For each line in the input, you should print out the decimal fraction value with the specified number of precision bits followed by a new line. Example Execution: Let's assume we have the following input file: input.txt 843 0x4d 2 8 4 3 0x16 7 Then the result will be: $./first input.text 6.50 .0546875
Expert Answer:
Answer rating: 100% (QA)
describes a programming task that involves converting a hexadecimal bit pattern to its decimal fractional value Heres a breakdown of the task and a possible solution Task Description The program takes ... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
re Regular Languages and Finite Automata (a) Let L be the set of all strings over the alphabet {a, b} that end in a and do not contain the substring bb. Describe a deterministic finite automaton...
-
Developments in Technology Light is incident from air on the end face of a multimode optical fibre at angle of incidence as shown below. n n 1 2 The refractive indices of the core and cladding are...
-
The condensed financial statements of Soule SpA for the years 2016 and 2017 are presented as follows. SOULE SpA Statements of Financial Position December 31 SOULE SpA Income Statements For the Years...
-
Deep ultrasonic heating is used to promote healing of torn tendons. It is produced by applying ultrasonic sound over the affected area of the body. The sound transducer (generator) is circular with a...
-
For the frame and loading shown, draw the free-body diagram(s) needed to determine the components of all forces acting on member ABC. 4 ft 20 kips
-
Defendant Monty J. Person began working for Garage Solutions, LLC, in March 2015. Three months into his employment, Person was sent by the owner of Garage Solutions, Mark Fontenot, to Rexburg, Idaho,...
-
Ignatenko's Custom Electronics (ICE) sells and installs complete security, computer, audio, and video systems for homes. On newly constructed homes it provides bids using time-and-material pricing....
-
Why are both ER Diagrams and Relational Modeling needed when a database system is developed?
-
Diagnostic techniques in nuclear medicine use radioactive tracers which emit gamma rays from within the body. One such tracer administered to patients decays according to the equation ????=1022????27...
-
8. A hockey puck of mass 0.38 kg is shot west at 2.20 m/s strikes a second puck, initially at rest, of mass 0.57 kg. As a result of the collision, the first puck is deflected at an angle of 40 south...
-
Why or what purpose was the Corporate Communication Unit/Department set up at many companies? Discussion must be supported with three Literature Reviews.
-
What resources or financial counseling services are available to help navigate the costs and potential financial burdens associated with cancer treatment and how can you strategically plan and manage...
-
1. Quintan's grandfather convinces him to hold his savings of $10,000 in cash . Assuming the average inflation rate is 3.45% every year, what will the real value (inflation adjusted) of Quintan's...
-
A share of Unicorn common stock is trading at $22.00 per share. It has a book value of $16.00 per share and generates earnings per share of $1.20. It has a beta of 1.2, the risk-free rate of return...
-
= tan 'a. log (x + y)+b tan), prove a'u, o'u ax Oy %3D
-
You are thinking of investing in one of two companies. In one annual report, the auditors opinion states that the financial statements were prepared in accordance with generally accepted accounting...
-
Suppose you are writing a program that asks the user to give a yes-or-no response. Assume that the program reads the users response into the Stringvariableresponse. a. If response is yes or y, set...
-
Write a Java program that serves as a primitive web browser. For this assignment it merely needs to input a server name and display the HTML that is sent by the web server. A web server normally...
-
Define a utility class for displaying values of type double. Call the class DoubleOut. Include all the methods from the class DollarFormat in Listing 6.14, all the methods from the class OutputFormat...
-
Calculate the principal direction corresponding to \(\sigma_{3}=-2\) in example 5.4. Data From Example 5.4: For the stress matrix given below, determine the principal stresses. 3 1 11 [0]=102 1 2 0
-
The state of stress at a point in the \(x y z\) coordinates is Determine the stress matrix relative to the \(x^{\prime} y^{\prime} z^{\prime}\) coordinates, which is obtained by rotating the \(x y...
-
If \(\sigma_{x x}=90 \mathrm{MPa}, \sigma_{y y}=-45 \mathrm{MPa}, \tau_{x y}=30 \mathrm{MPa}\), and \(\sigma_{z z}=\tau_{x z}=\tau_{y z}=0\), compute the surface traction...
Study smarter with the SolutionInn App