Skip to content
Get 50% Off with Promo Code: BlackFriday21
Check it Out
Marketing – vCMO
About Matthew Maennche
C++ Solutions Map
Java Solutions Map
Visual Basic Solutions Map
Learn To Code
Microsoft Dynamics CRM
Assume that m is an int variable that has been given a value. Write a statement that prints it out in a print field of 10 positions.
Write the necessary preprocessor directive to enable the use of the stream manipulators like setw and setprecision.
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..
Write the necessary preprocessor directive to enable the use of the exit function.
Given a bool variable fileExists write the necessary code to set this variable to true if the file “crucial_data” exists and sets it to false otherwise.
Given a bool variable isReadable write some statements that assign true to isReadable if the file “topsecret” exists and can be read by the program and assigns false to isReadable otherwise.
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 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.
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.
Given the availability of an ofstream object named output, write the other statements necessary to write the string “3.14159″ into a file called pi. (Do not define a main function.)
Given an ofstream object named output, associate it with a file named yearsummary.txt by opening the file for writing.
Define two objects named outfile1 and outfile2 that can be used to write data from program variables to two different files.