Write the necessary preprocessor directive to enable the use of the exit function. Write the definition of a function named panic. The function prints the message “unrecoverable error” and then terminates execution of the program, indicating failure..

C++

LANGUAGE: C++ CHALLENGE: Write the necessary preprocessor directive to enable the use of the exit function. Write the definition of a function named panic. The function prints the message “unrecoverable error” and then terminates execution of the program, indicating failure.

Read More

Given an int variable x write some statements that attempt to open a file named “table20″ and read a value into x; if that turns out not to be possible your code should then read avalue from standard input into x.

C++

LANGUAGE: C++ CHALLENGE: Given an int variable x write some statements that attempt to open a file named “table20″ and read a value into x; if that turns out not to be possible your code should then read avalue from standard input into x.

Read More

Read first a user’s given name followed by the user’s age from standard input. Then use an ofstream object named outdata to write this information separated by a space into a file called outdata. Assume that this is the extent of the output that this program will do.

C++

LANGUAGE: C++ CHALLENGE: Read first a user’s given name followed by the user’s age from standard input. Then use an ofstream object named outdata to write this information separated by a space into a file called outdata. Assume that this is the extent of the output that this program will do.

Read More

Given the availability of an ifstream object named indata and an ofstream object named outdata, write the other statements necessary to read one integer from a file called currentsales and write twice its value into a file called projectedsales. Assume that this is the extent of the input and output that this program will do.

C++

LANGUAGE: C++ CHALLENGE: Given the availability of an ifstream object named indata and an ofstream object named outdata, write the other statements necessary to read one integer from a file called currentsales and write twice its value into a file called projectedsales. Assume that this is the extent of the input and output that this…

Read More