Question: -C++ Code Vulnerabilities- Looking for formatted output vulnerabilities in the code posted below or where this code avoided possible formatted output problems. Looking for three

-C++ Code Vulnerabilities-

Looking for formatted output vulnerabilities in the code posted below or where this code avoided possible formatted output problems. Looking for three or more answers corresponding to this code and vulnerabilities having to do with formatting input and output errors and some explanation of what those vulnerabilities are and how to solve/avoid them. Thanks!

#include //header file #include using namespace std; //main function int main() { //variable delcaration in double double overtime ,rate , hours ,salary; //pointer variable declaration int *ptrovertime = new int(); int *ptrRate = new int(); int *ptrhours = new int(); //asking user to enter the rquired value and store in variable cout<<"Enter standard hours worked: "; cin>>hours; //enter hours cout<<"Enter the pay rate: "; cin>>rate; //enter rate cout<<"Enter overtime hours worked: "; cin>>overtime; //enter overtime //calculate salary salary = hours * rate + (1.5 * overtime * rate); //initialize pointer variable ptrhours = (int*)&hours; ptrRate = (int*)&rate; ptrovertime = (int*)&overtime; //display the output cout<

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!