Accept input from the user and verify that they have entered

Assignment Help Computer Engineering
Reference no: EM132107930

(PROGRAMMING IN C)

Write a program which can accept binary numbers and certain operations to calculate the results of those operations. The user should see something like:

Enter a 16 bit unsigned binary number:

Enter operator (+, -, *, %, /, <<, >>, |, &, ^, E)

Enter a 16 bit unsigned binary number:

The answer is: (note: the answer should be displayed in both binary and decimal)

Enter operator (+, -, *, %, /, <<, >>, |, &, ^, E)

Enter a 16 bit unsigned binary number:

The answer is: (note: this should perform the operation on the previous answer and the newly entered number)

The program should continue in this manner, until E is entered as the operator. When E is entered, the program should terminate. Hints: partition up the problem.

Create subroutines to:

• Accept input from the user and verify that they have entered a 16 bit binary number (note: you'll need to handle binary numbers as strings)

• Convert a string holding a binary number to an unsigned integer

• Convert an unsigned integer to a string holding a binary representation of that number

• Accept two numbers and an operator, perform the noted operation (hint: only capture the first < from << or > from >>, doing so will allow you to handle the operator as a simple character) Hint #2: use fgets and sscanf to take user input. scanf alone will be tough to get correct.

Reference no: EM132107930

Questions Cloud

Write a program to load the names in the combo box : Create an SQL or Access database with all your friends' information and write a program to load the names in the combo box.
Present value of the cash flows : What is the present value of the cash flows from your lottery winnings?
Test case a single line comprising the passages : IBM cognitive computing|IBM "cognitive" computing is a revolution| ibm cognitive computing|'IBM Cognitive Computing' is a revolution?
What is the modified duration of portfolio : The term structure is flat, and all spot rates are 3%. What is the modified duration of your portfolio?
Accept input from the user and verify that they have entered : Accept input from the user and verify that they have entered a 16 bit binary number (note: you'll need to handle binary numbers as strings)
What interest rate would you expect to pay on the issue : If the 10 year maturity premium is 0.4%, what interest rate would you expect to pay on the issue?
Create an array of pointers to cards that are in the correct : In this problem you will shuffle a deck of cards where each card is represented by a twocharacter string.
Required rate of return on stocks : What should the firm's price-to- earnings (P/E) ratio be if the required rate of return on stocks of this type is 15 percent?
Provide a comparison to the health care organization : Research a health care organization or a network that spans several states within the U.S. (Example: United Healthcare, Vanguard, Banner Healthcare, etc.)

Reviews

Write a Review

Computer Engineering Questions & Answers

  What does the php function mysql-fetch-array do

What does the PHP function mysql_fetch_array do? Explain the exact form of the value returned by mysql_fetch_array.

  What to describe as a free online security check

A number of web based firms offer what they describe as a free online security check of your PC or network

  What happens if both the control signals are at zero

In your design in Problem I, what happens if both the control signals are at 0 and a clock pulse comes along? Redesign the circuit (if necessary) to prevent.

  Prepare monthly cash budgets for each of first three months

Kayak Co. budgeted the following cash receipts. Prepare monthly cash budgets for each of the first three months of next year.

  What kinds of applications can be supported

What kinds of applications can be supported, what equipment will be necessary, where the equipment will be located, and what services this company offers.

  What is the relationship between a tcp and udp packet

What is the typical relationship among the untrusted network, the firewall, and the trusted network and What is the relationship between a TCP and UDP packet? Will any specific transaction usually involve both types of packets.

  Studying the properties of a network

Studying the properties of a network

  How many blocks can be stored in each level of the memory

CS 152 Computer Systems Architecture Midterm Examination. How many blocks can be stored in each level of the memory hierarchy

  Outline sound practices for reducing input errors

Outline sound practices for reducing input errors. Briefly discuss each

  Determine the product vision and provide strategies

Determine the product vision and provide strategies for how to conduct the envisioning practice. Determine the main roles of the Agile project team and explain.

  Explain organizational requirements that would be address

Explain how you would choose the necessary topology, routers, switches, media, etc. Discuss reasons for choosing those technologies and explain the organizational requirements that would be addressed.

  Representing text and numbers problem 11 latin alphabetic

representing text and numbers problem 1.1 latin alphabetic characters can be represented using their ascii equivalents.

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