Steven_Barry_Week7_ Assignment

Steven_Barry_Week7_ Assignment - Read account1,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
The Last National Bank has two branches, each of which uses a sequential file containing a summary of customers’ checking accounts in the form account number (integer), customer name (string), balance (real) The files, which are called ACCOUNT1 and ACCOUNT2, are ordered by account number in increasing order. (Assume that no two account numbers are the same.) Due to financial reverses, one of the branches must be closed, and the two files need to be merged into a single one called ACCOUNT3. Write a program to perform this operation. Declare AccountNumber1, AccountNumber2 as Integer Declare Name1, Name2 as String Declare Balance1 ,Balance2 as Real Open”ACCOUNT1” For input as account1 Open”ACCOUNT2”For input as account2 Open”ACCOUNT3” For Output as ACCOUNT3
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Read account1, AccountNumber1, Name1, Balance1 Read account2, AccountNumber2, Name2, Balance2 While AccountNumber1<>0 And AccountNumber2<>0 If AccountNumber1<AccounNumber2 Then Write ACCOUNT3, AccountNumber1, Name1, Balance1 Read account1, AccountNumber1, Name1, Balance1 Else Write ACCOUNT3, AccountNumber2, Name2, Balance2 Read account2, AccountNumber2, Name2, Balance2 END If END While While AcountNumber1<>0 Write ACCOUNT3, AccountNumber1, Name1, Balance1 Read account1, AccountNumber1, Name1, Balance1 End While While AccountNumber2<>0 Write ACCOUNT3, AccountNumber2, Name2, Balance2 Read account2, AccountNumber2, Name2, Balance2 End While Write ACCOUNT3, 0, ”0”, 0 Close account1, account2, ACCOUNT3...
View Full Document

This note was uploaded on 01/15/2012 for the course IT 210 210 taught by Professor Professory during the Spring '10 term at University of Phoenix.

Ask a homework question - tutors are online