please can some Help me ???? 
Author Message
 please can some Help me ????

just need to display the amount they are overdrawn by now ????
if they have an overdraft limit of 50 and they are overdrawn by 60 how do
you display the amount they are over there limit ???
any ideas !

Program bankbalancebook;
Uses wincrt;

VAR

negative: Text;                                       {declare negative file
variable}

Correspondence: Text;                 {declare correspondence file variable}

Type
bankrec = record                                               { declare
record type}
                                                             {Declare
records in file}
accountnumber : integer;
Name: string [16];
Address: string [20];
Balance: integer;
Overdraft: integer;
End;

Customerfile = file of bankrec;
{customerfile is declared as a file of bankrec}
bankarray = array [1..22]of bankrec;
                                                      {Initialisation of
array for holding records}

var
{Declaration of variables}
Bankers: customerfile;
Customer: bankarray;
Num: integer;
Count, amount, number, numbs, figure: integer;

{-------------------------------------------------------------}

{Procedure to sift through file and output customers with a negative
balance}

Procedure negative_balance (var customer: bankarray; var num: integer);

var

Index: integer;                                         {declare variable
within procedure}
begin
Assign (bankers,'a:customer.rec');                   {assign customer.rec
file to procedure}
Reset (bankers);                                                      {open
bakers file to read data}
writeln('******THESE ARE THE FILES OF ALL CUSTOMERS WITH A NEGATIVE
BALANCE********');
WRITELN;
writeln ('ACCOUNT NO':8, ' NAME
':10,'ADDRESS':20,'BALANCE':20,'OVERDRAFT':15);
writeln ;
Index := 1;
{initialise index}

While not eof (bankers) do
{start while loop}

Begin

Read (bankers,customer[index]);                                        {read
records from array}
Number := Number + 1;                 {counter for total number of original
records}
Index := index + 1;                {index incremented for the reading of the
next record}

End;                                          {end while}
Close (bankers);                                                   {bankers
file is closed}
Num := index - 1;                                                   {sorting
file}
For index := 1 to num do
If customer [index].balance < 0 then
                                  {Selection loop for customers with
negative balance}
writeln
(customer[index].accountnumber:8,customer[index].name:15,customer[index].add
ress:20,'',customer[index].balance:5,'' ,
customer[index].overdraft:4);
{Output details of customers}
End;                                             {end of procedure
negative_customers}

{----------------------------------------------------------------}

 {Procedure to create a file for the negative customers, with parameter
calling}

 Procedure create_negative_file( var customer: bankarray; var num: integer);

var index: integer;

Begin
{Assign original file to procedure and create a new file to store output}

Assign (bankers,'a:\customer.rec'); ASSIGN(NEGATIVE,'A:NEGATIVE.rec');
{Open original file and write to new file}

Reset (bankers);
Rewrite (NEGATIVE);

writeln('******THESE ARE THE RECORDS OF ALL CUSTOMERS WITH A NEGATIVE
BALANCE********');
writeln;
writeln(' ACCOUNT NO':8, ' NAME ':10, 'ADDRESS':20, 'BALANCE':20,
'OVERDRAFT':15);
writeln;
Index := 1;
 {Start of while loop}
While not eof (bankers) do
Begin
Read (bankers,customer[index]);
Index := index + 1;
End;
Close (bankers);                                                     {close
bankers file}

{Search records}
Num := index - 1;
 {Start of for loop to select customers}
For index := 1 to num do

If customer [index].balance < 0 then

writeln

(customer[index].accountnumber:8,customer[index].name:15,customer[index].add
ress:20,'',customer[index].balance:5,'',
customer[index].overdraft:4);

For index := 1 to num do
If customer [index].balance < 0 then
 Amount := amount +1;              {counter for total number of records}
Reset (negative);                       {force data from memory buffer to
new file created}

End;

{---------------------------------------------------------------}

PROCEDURE IN_RED(CUSTOMER: BANKARRAY; VAR NUM: INTEGER);
VAR
INDEX : INTEGER;
extra : real;

BEGIN
assign(bankers,'a:\customer.rec');
reset ( bankers);
writeln('******THESE ARE THE RECORDS OF ALL CUSTOMERS WHO ARE IN RED
BALANCE********');
WRITELN;

WRITEln (' ACCOUNT NO':8, ' NAME ':10, 'ADDRESS':20, 'BALANCE':20,
'OVERDRAFT':15);
WRITELN;

Index := 1;
While not eof (bankers) do
Begin

Read (bankers,customer[index]);
Index := Index + 1;
Extra := CUSTOMER [INDEX].OVERDRAFT * 0.1;
End;
Close (bankers);
Num := Index - 1;

For Index := 1 to num do

If customer [index].overdraft < - customer [index].balance then

 writeln (customer[index].accountnumber:8,customer[index].name:15,
Customer [index].address:20, '', customer [index].balance:5, '', customer
[index].overdraft:4);

If (customer [index].overdraft = 0) and (customer [index].balance < 0)
Then
writeln (customer[index].accountnumber:8,customer[index].name:15,
Customer [index].address:20, '', customer [index].balance:5,' ', customer
[index].overdraft:4);
End;

{---------------------------------------------------------------}

Procedure CREATE_IN_RED_FILE (CUSTOMER: BANKARRAY; VAR NUM: INTEGER);
VAR
Index, exceed: Integer;
Extra: Real;

Begin
Assign (bankers,'a:\customer.rec');
Assign (CORRESPONDENCE,'A:\CORRESPONDENCE.REC');
Reset (bankers);
Rewrite (CORRESPONDENCE);
writeln('****** FILE CREATED FOR ALL CUSTOMERS IN RED********');
writeln ;
Index := 1;
While not eof (bankers) do
Begin

Read (bankers, customer [index]);
Index := Index + 1;
End;
Close (bankers);

Extra := customer [index].overdraft * 0.1;
Num := Index - 1;
For Index := 1 to num do

 If customer [index].overdraft < - customer [index].balance then

 writeln (customer[index].accountnumber:8,customer[index].name:15,
customer [index].address:20, ' ', customer [index].balance:5,' ', customer
[index].overdraft:4);

If (customer [index].overdraft = 0) and (customer [index].balance < 0) Then

writeln (customer[index].accountnumber:8,customer[index].name:15,
customer [index].address:20, ' ', customer [index].balance:3,' ', customer
[index].overdraft:3);

  For Index := 1 to num do

IF customer [index].overdraft < - customer [index].balance then
Count:= Count +1;
If (customer [index].overdraft = 0) and (customer [index].balance < 0) Then

Numbs := numbs +1;
 Figure := numbs + count;

For Index := 1 to num do
IF customer [index].overdraft < - customer [index].balance then
If (customer [index].overdraft = 0) and (customer [index].balance < 0) Then

 Exceed := - customer [index].balance - customer [index].overdraft;

  writeln(customer[index].name:15, customer[index].address:20, exceed);
Reset (Correspondence);
End;

{----------------------------------------------------------------}

Begin

negative_balance( customer,num);
writeln('Please Press Enter to Continue');
readln;

CREATE_negative_FILE( customer,num);
writeln('Please Press Enter to Continue');
readln;

IN_RED ( customer,num);
writeln('Please Press Enter to Continue');
readln;

CREATE_IN_RED_FILE ( customer,num);
writeln('Please Press Enter to Continue');
readln;

writeln('number of records in  original file is :'  ,  number );
writeln('Please Press Enter to Continue');
readln;

writeln('number of records in  negative file is:'  , amount );
writeln('Please Press Enter to Continue');
readln;

writeln('number of records in ovverdrawn file is:'   ,  figure);
writeln('Please Press Enter to Continue');
readln;

End.



Fri, 21 Nov 2003 22:59:11 GMT  
 please can some Help me ????
Ms. Carnage:

If the customer has an overdraft limit then that limit should be a part of
the customer's record.  Net the balance with the limit when needed.

                                                                         -I
Vehicle



Sat, 22 Nov 2003 08:36:22 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. It's not bad canned meat...

2. Please, please help me with this code.

3. Please Please, help me with memo-fields, real problem

4. Help Drag and drop please please

5. please, I beg of you help me please.

6. PLEASE PLEASE HELP ME

7. Please Please help me

8. please,please,please H E L P (tic tac toe)

9. Please, please, please H E L P (tic tac toe)

10. Program Idea Please please please

11. Program Idea Please Please Please

12. Graph.tpu for pascal wanted please, please, please.

 

 
Powered by phpBB® Forum Software