Write a program that will read a series of lines

Assignment Help C/C++ Programming
Reference no: EM131891049

Programming Assignment

Write a program that will read a series of lines from an input file named hw8in.txt. Each line will contain 3 values:

A whole number
A numerator
A denominator

Collectively, these 3 values represent a floating point number. For example, a possible line of input might be:

3  3  4
This will become: 3.0 + 3.0 / 4.0 or 3.75

Your program will store this value in a float (Do NOT use double) and will display to the console, both its float and floating point binary values. Again using the above float from the input file, the output would be:

Floating point format of 3.750000000000000:
0  10000000  11100000000000000000000

Your program must create the same output as shown in the sample run that is included below. This includes breaking the 32 bits into 3 separate fields (sign, exponent, and fraction).

NOTE: Due to the input format of whole, numerator, denominator, you will need to use 0 1 for the last 2 digits if there is no fractional portion to the entire value to be evaluated. E.g. 5 0 1 will evaluate to 5.0.

Design your own input file (Hw8in.txt) and include as many variations of input as needed to fully test your program.

Write the entire program in one .c file (Hw8.c). Organize your solution into a sensible set of functions. As always, turning in code you may find on the internet is not acceptable. The goal of the assignment is for you to practice manipulating bits.

The float data type of C usually requires 32 bits (or 4 bytes). To ensure this is true for your machine, try this: printf("float size in bytes: %d", sizeof(float)); If the value printed out is not 4, please talk to me about how to do the assignment.

Attachment:- Input-file.rar

Reference no: EM131891049

Questions Cloud

Prepare a list of questions to conduct the interview : Read the complete description for the Final Paper in the Final Paper link. This paper will require you to select an interview subject.
Planning on retirement at age : Assume that you are 30 years old? today, and that you are planning on retirement at age 65. Your current salary is? $45,000 and you expect
Which project would be selected : Which project would be selected, assuming they are mutually exclusive, using each ranking method? Which should actually be selected. Show your work
What would be the present value : What would be the present value if the money is compounded monthly?
Write a program that will read a series of lines : Write a program that will read a series of lines from an input file named hw8in.txt. Design your own input file (Hw8in.txt) and include as many variations.
What is sylvester amti : Sylvester files as a single taxpayer during 2017 and claims one personal exemption. What is Sylvester's AMTI if he used the home-equity proceeds to purchase car
What is the most the company should invest today : If management wants to get a minimum of 6% per year rate of return out of this investment, what is the most the company should invest today
Use of game theory in business intelligence systems : Write a research paper around 7 pages on Use of Game Theory in Business Intelligence Systems.
Explain the most influential definition of health : The most influential definition of health as being "a state of complete physical, mental, and social well-being and not merely the absence of disease.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd