Write a program that asks the user for an integer value

Assignment Help Computer Engineering
Reference no: EM132207705

Question :

Write a program that asks the user for an integer value (may be negative) and that outputs the bit pattern for that integer, starting with the most significant bit.

You should use an int data type which, on nearly all modern compilers, is a 32-bit value. Your output should print the decimal value, the 8-digit hexadecimal representation, and the 32-bit binary bit pattern with the bits in groups of four separated by a space.

You are required to write (and use) the function-like macro testbit(integer, position) that evaluates to true (1) or false (0) depending on if the bit in the indicated position (with 0 being the least significant bit) is a 1 or 0, respectively.

Run your program for a selection of small, moderate, and large integer values, both positive and negative, placing the results in a ReadMe.txt file.

NOTE: DO NOT to use any library functions that perform the significant tasks, such as rounding a value to the nearest cent.

Reference no: EM132207705

Questions Cloud

Estimate the price and income demand elasticities : If the subsequent year the retail price is expected to rise to 38,500 GBP, whilst income should increase around 5%. Estimate demand and manufacturer's revenue.
Store the updated prices in the second column of the array : Write the program so that it asks the user for a dollar amount by which each price should be increased.
Write a program that allows users to encrypt files : We will implement two simple encryption methods. Have the following GUI components: Have a button that when pressed opens a FileChooser.
What are the reserve-deposit ratio : In the nation of Dorne, the monetary base is $1,000,000. Suppose that the people of Dorne hold 1/4 of their money in the form of currency and 3/4 in bank.
Write a program that asks the user for an integer value : Write a program that asks the user for an integer value and that outputs the bit pattern for that integer, starting with the most significant bit.
Evaluation of adequacy of the surgical margins : Two separately identified basal cell carcinomas are submitted for diagnosis and evaluation of adequacy of the surgical margins.
Changes between prior to and after buying equipment : Compute the productivity changes between the Prior to and after buying the new equipment.
Operation in fees generated per dollar of input : Calculate the multifactor productivity for this operation in fees generated per dollar of input.
Market pay to set their employees pay and incentives : Describe how organizations use surveys and market pay to set their employees pay and incentives.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mutual authentication and key establishment protocol

Assume a server-assisted mutual authentication and key establishment protocol. Suppose that Alice and the Server share the pairwise symmetric key KAS; however Bob and Server share a pairwise symmetric key KBS.

  Write the structural vhdl code to implement device

Two voltage and two current sensors indicate measured voltage with 16-bit binary values on their output lines, S15 to S0.

  Write a c program that will read the required values

Write a C program that will read the required values from the input file into two one-dimensional arrays.

  Implementing class diagram

Design a class diagram representing a book described by the following statement. “A book comprises of the number of parts that in turn are composed of the number of chapters.

  Write a game program guess which tries to guess

You will want to keep track of the range of numbers that might have been chosen based on the answers that have been given so far until there is only one number left. You can approximately divide an integer by 2 by right-shifting it by one bit.

  Program can be used with a video rental business

Extend above with a Rental class. This class must store a Movie that is rented, an integer representing the ID of the customer who rented the movie, and an integer indicating how many days late the movie is.

  Write a test program that prompts the user to enter

Write a test program that prompts the user to enter a, b, c, d, e, and f and displays the result.

  Create an manages a 2d array of ints

Creates an manages a 2d array of ints. It has a constructor that takes a 2d array as a parameter and assigns it to the instance variable.

  What can be done to minimize the errors

Where are the majority of defects found in a final program introduced? What can be completed to minimize these errors.

  Explain the method to find cost of sorting the relation

Explain the method to find cost of sorting the relation In each case, how many combine passes are required?

  Why is this an important function

When working with R, in what scenario might you need to convert a list into a matrix? Why is this an important function?

  Discuss about the reliability characteristic

Study from the literature about the reliability characteristic and its major issues in developing and implementing application for the organization.

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