Question: Directions These questions require you to write small C/C++ programs to demonstrate certain features. You should write a program to answer each question. You must

Directions

These questions require you to write small C/C++ programs to demonstrate certain features. You should write a program to answer each question. You must test your program(s) in Microsoft Visual Studio 2017 and show us the final product (C/C++ code and a sample run). Do not forget to explain the purpose of the programs in plain English.

Questions

1. Present a complete and syntactically correct example of C/C++ code that prevents improper division by zero, remainder by zero OR overflow by division when dividing either signed short or signed char data types (select one operation and one data type). Explain in English which vulnerabilities are being prevented.

2. Present a complete and syntactically correct example of C/C++ code that uses tolerance properly applied to the comparison of two float variables.

3. Present a complete and syntactically correct example of C/C++ code that verifies that the parameters for a mathematical function are within their allowable value ranges. Indicate in English which are those allowable value ranges.

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!