Question: 1. Write the statement to open a sequential access file named inventory.txt for input. The file is associated with the inInventory object. 2. Write the

1. Write the statement to open a sequential access file named inventory.txt for input. The file is associated with the inInventory object.
2. Write the statement to open a sequential access file named firstQtr.txt for append. The file is associated with the outSales object.

3. A program needs to write the string “INVENTORY” and the string “SALES” to the sequential access file associated with the outFile object. Each string should appear on a separate line in the file. Write the code to accomplish this task.

Step by Step Solution

3.47 Rating (167 Votes )

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 Programming Questions!