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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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