The customer credit manager of the Greenly Department Stores has requested a new program to perform the weekly update of the customer account file. This account file contains information on all of the customer's who have charge account with the company. A customer's account must be changed when a purchase is charged or a payment is made. An account must be also be changed when the credit manager raises or lowers a customers credit limit. The data entry staff enters all changes into a text file. Once a week the items in this text file are used to bring the accounts up to date.
Input : 1. A sequential file(Old_Master.Dat) containing an account number, a name, an address, a credit limit, and a current balance for each customer. 2. A text file(Transaction.txt) . Each line in this file contains the information for a single customer transaction. This information includes a.Account Number-A unique number that identifies the customer. b.Transaction Type-The word Payment, Charge, or Limit. c.Transaction Amount-A positive float value. Output : 1. A new sequential file(New_Master.Dat) that contains all of the updated customer information. 2. A text file(Report.txt) containing a line for each customer whose balance is over his or her assigned credit limit. This line should contain the account number, customer name, and the amount the balance is over the credit limit.
Part 1
Modify the Department Store program so that it handles transactions to delete accounts from the store's files. A delete transaction contains the account number and the word Delete. An account is deleted by not writing the account record to the new master file. So that any outstanding balance can be billed to the proper person, all the account information should be written to the report file with an appropriate message.
Modify the program create.adb so that it accepts 5 records from the user and stores them in the sequential file called Old_Master.Dat.
The message that should be written in the report file is <Account number> <First Name> <Last Name> Deleted <Balance>
Part 2
Modify the update.adb and create.adb so that the type declarations are declared in the specification package called Customer_Accounts in the file Customers_Accounts.adb. The program create.adb and update.adb would include this package.
create.adb : To create the Old_Master.Dat file
update.adb : To create the New_Master.Dat file
Customer_Accounts.ads:To contain the specification package which has
declarations in it.
Steps :
1. To make a file called Customer_Accounts.ads
..package Customer_Accounts is ....
.......subtype Name_String is String (1..5);
.......subtype Address_String is String (1..5);
.......subtype State_String is String (1..2);
....type Name_Rec is -- For customer name
.......record
.........First : Name_String;
.........Last : Name_String;
....... end record;
....type Address_Rec is -- For customer address
.......record
........Street : Address_String;
........City : Address_String;
........State : State_String;
........Zip : Positive;
......end record;
....type Customer_Rec is -- Customer Account information
.......record
.........Account_Number : Positive;
.........Name : Name_Rec;
.........Address : Address_Rec;
.........Credit_Limit : Float;
........Balance : Float;
......end record;
2. Compile the program Customer_Accounts.ads
3. Remove the declarations from create.adb and include the statement "with Customer_Accounts" at the beginning.
4. Remove the declarations from update.adb and include the statement "with Customer_Accounts" at the beginning.
Professor:Dr.Stansifer
G.S.A : Rishi Gupta
Last Modified :4/10/99