Question: Write these programs in C ONLY This assignment is designed to help you learn the representation, interpretation, and manipulation of data in its internal representation.

Write these programs in C ONLY

Write these programs in C ONLY This assignment is designed to help

you learn the representation, interpretation, and manipulation of data in its internal

representation. There are two parts. In the first part, you will implement

This assignment is designed to help you learn the representation, interpretation, and manipulation of data in its internal representation. There are two parts. In the first part, you will implement a program calc to add and subtract numbers specified in different bases (multiplication is extra credit). In the second part, you will implement a program format that will print the decimal values of bit sequences representing integer and floating point data types. 2 Numeric Base Conversion and Calculator Implement a program called calc with the following usage interface: calc The first argument, , is either the string "+", for addition, or "-", for subtraction. If you want to implement multiplication, then can also be the string". (If you do implement multiplication, make sure to say so in your readme.pdf file so that the TAs know to check your program for this functionality.) The next two arguments, and are 64-bit, two's-complement integers. Each of these numbers will be given in the form of: which can be interpreted as: a base indicator where b means that the number is a binary number, o means octal, r means hexadecimal and d means decimal. dndn-1...dido are the digits of the number. A decimal number may be preceded by a minus sign. Note that a minus sign is neither meaningful nor necessary for binary, octal or hexadecimal numbers as the bit pattern for these representations already covers positive and negative quantities. The final argument, , gives the base for the resulting output number. Like the base indicator for the input numbers, this argument can be one of four strings: "b" for binary, "o" for octal, "d" for decimal, and "r" for hexadecimal. Your program should output the answer in the same form as the input numbers (that is, the output number should follow the regular expression given above) Some examples

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!