Answered step by step
Verified Expert Solution
Link Copied!

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 add_numbers() and subtract_numbers() functions to detect, prevent, and notify the caller of a numeric overflow. You will also modify the calling test_overflow and test_underflow 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
C/C++ 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 add_numbers() and subtract_numbers() functions to detect, prevent, and notify the caller of a numeric overflow. You will also modify the calling test_overflow and test_underflow 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
C/C++ 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2016 Riva Del Garda Italy September 19 23 2016 Proceedings Part 3 Lnai 9853

Authors: Bettina Berendt ,Bjorn Bringmann ,Elisa Fromont ,Gemma Garriga ,Pauli Miettinen ,Nikolaj Tatti ,Volker Tresp

1st Edition

3319461303, 978-3319461304

More Books

Students also viewed these Databases questions

Question

What went well in the mediation process?

Answered: 1 week ago

Question

10-9 How have social technologies changed e-commerce?

Answered: 1 week ago