Assume that each of the following statements applies to the same program.
a) Write a statement that opens file oldmast.txt for input; use an ifstream object called inOldMaster.
b) Write a statement that opens file trans.txt for input; use an ifstream object called inTransaction.
c) Write a statement that opens file newmast.txt for output (and creation); use ofstream object outNewMaster.
d) Write a statement that reads a record from the file oldmast.txt. The record consists of integer accountNumber, string name and floating-point currentBalance; use ifstream object inOldMaster.
e) Write a statement that reads a record from the file trans.txt. The record consists of integer accountNum and floating-point dollarAmount; use ifstream object inTransaction.
f) Write a statement that writes a record to the file newmast.txt. The record consists of integer accountNum, string name, and floating-point currentBalance; use ofstream object outNewMaster.
a) ifstream inOldMaster( "oldmast.txt", ios::in );
b) ifstream inTransaction( "trans.txt", ios::in );
c) ofstream outNewMaster( "newmast.txt", ios::out );
d) inOldMaster >> accountNumber >> name >> currentBalance;
e) inTransaction >> accountNum >> dollarAmount;
f) outNewMaster << accountNum << name << currentBalance;
You might also like to view...
When a derived class constructor calls its base class constructor, what happens if the base class’s constructor does not assign a value to an instance variable?
a) a syntax error occurs b) a compile-time error occurs c) a run-time error occurs d) the program compiles and runs correctly because the instance variables are initialized to their default values
Give an example of a serializable schedule that could be produced at SNAPSHOT isolation, but could not be produced by a strict two-phase locking concurrency control.
What will be an ideal response?