Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write code in C please. Part 2: A safe calculator (100 points) In this project, you will write a safe signed integer calculator. As with
Write code in C please.
Part 2: A safe calculator (100 points) In this project, you will write a safe signed integer calculator. As with Part 1, some of the code is completed for you and there are descriptions and comments to help. You should not use any arithmetic operators, except simple assignment, or increment and decrement operators in your code. The_add), an add function that only uses bitwise operators, and add(), a safe add function that detects and reports overflow and underflow errors, are crucial to the other functions. The seven remaining functions either directly or indirectly depend on_add() and add(). Code these functions to in their order to maintain functional dependencies. Use the main function to test each function before continuing to the next function 1. 2. 3. Negation is defined using a bitwise operator and the add() function Subtraction is defined using Negation and add() functions Multiplication is defined with successive add() function and Subtraction function calls a. Should perform with positive integers and keep track of which sign the product has 4. Division is defined with successive Subtraction and add) function calls 5. Modulus is defined as successive calls to Subtraction to return a remainder 6. Power is defined as successive calls to Multiply and Subtraction 7. Convert converts an input string to an integer value Should perform with positive integers and keep track of which sign the result has Should perform with positive integers Only use positive exponents Pay attention to comments - This is the longest function a. a. a. a. b. You may be able to modify your dec_to_uint() fromStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started