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;

Computer Science & Information Technology

You might also like to view...

________ themes determine how the backgrounds, text, and hyperlinks appear on a SharePoint Online site

A) Page B) Font C) Color D) Site

Computer Science & Information Technology

Any expression that evaluates to a(n) ____ may be used as a subscript.

A. integer B. constant C. scalar D. offset

Computer Science & Information Technology

When you export an object from Access to Word, Access creates a file in the ________ format.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

What is the de facto protocol suite of the Internet?

A. NetBEUI B. TCP/IP C. IPX/SPX D. UNIX

Computer Science & Information Technology