Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Prompt This assignment presents code that is designed to show the two functions operating with and without overflow or underflows. Using the existing source code,
Prompt
This assignment presents code that is designed to show the two functions operating with and without overflow or underflows. Using the existing source code, you will add logic to the addnumbers and subtractnumbers functions to detect, prevent, and notify the caller of a numeric overflow. You will also modify the calling testoverflow and testunderflow functions to be notified of success or failure of the add or subtract functions they call, and to modify them, the functions write to the console with overflow status true or false and the numeric result of the function.
The following are a few key notes:
The source code has been commented with TODOs to explain the detailed rules you must follow.
There are comments that mark code that must be changed.
There may be more than one way to solve this problem, so be sure to demonstrate that you can detect an underflow or overflow, prevent it and communicate it back to the calling function.
Remember to leverage capabilities provided by the standard C library to help you achieve success.
Please comment on any changes you make in the code to explain the logic, formulas, or data types you are adding. You will also create a brief written summary of the approach taken. It should explain how this approach is designed to stop the overflow or underflow, any issues you encountered, and how you resolved those issues.
Specifically, you will prepare the following:
Numeric overflow and underflow secure coding
CC program functionality and best practices
A summary of your process in a Word document that contains a screenshot of the application console outputPrompt
This assignment presents code that is designed to show the two functions operating with and without overflow or underflows. Using the existing source code, you will add logic to the addnumbers and subtractnumbers functions to detect, prevent, and notify the caller of a numeric overflow. You will also modify the calling testoverflow and testunderflow functions to be notified of success or failure of the add or subtract functions they call, and to modify them, the functions write to the console with overflow status true or false and the numeric result of the function.
The following are a few key notes:
The source code has been commented with TODOs to explain the detailed rules you must follow.
There are comments that mark code that must be changed.
There may be more than one way to solve this problem, so be sure to demonstrate that you can detect an underflow or overflow, prevent it and communicate it back to the calling function.
Remember to leverage capabilities provided by the standard C library to help you achieve success.
Please comment on any changes you make in the code to explain the logic, formulas, or data types you are adding. You will also create a brief written summary of the approach taken. It should explain how this approach is designed to stop the overflow or underflow, any issues you encountered, and how you resolved those issues.
Specifically, you will prepare the following:
Numeric overflow and underflow secure coding
CC program functionality and best practices
A summary of your process in a Word document that contains a screenshot of the application console output
Step 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