Program to find interest on bank deposits, COBOL Programming

Assignment Help:

PROGRAM TO FIND INTEREST ON BANK DEPOSITS:

We have to write a program to find interest on deposits. The criteria is given below :

960_PROGRAM TO FIND INTEREST ON BANK DEPOSITS.png

identification division.

program- id.

environment division.

input-output section.

file-control.

  select bankfile assign to disk

  organization is line sequential.

data division.

file section.

fd bankfile  

  label records are standard

  value of file- id is "bank.dat".

01 bankrec.

  02 dno   pic 9(5).

  02 dname pic x(21).

  02 p     pic 9(4)v9(2).

  02 n     pic 9(2).

working-storage section.

01   ans pic x value space.

01   tot pic 9(6)v9(2) value 0.

01   int pic 9(6)v9(2) value 0.

01   key- in pic x value space.

01 r pic 9(2) value 0.

01 head-1 pic x(80) value all '-'.

01 head-2.

02  f pic x(8) value "Deps No".

    02  f pic x(3) value spaces.

    02  f pic x(10) value "Deps Name".

    02  f pic x(5) value spaces.

    02  f pic x(8) value "Deposit".

    02  f pic x(5) value spaces.

    02  f pic  x(8) value "Period".

    02  f pic x(5) value spaces.

    02  f pic x(5) value "Rate".

    02  f pic x(5) value spaces.

    02  f pic x(8) value "Interest".

    02  f pic x(10) value "  Nett".

  01  head-3.

    02  e-dno  pic z(5).

    02  e-dname pic x(26).

    02  e-p  pic  z(4).z(2).

  02  f pic x(5) value spaces.

  02  e-n  pic z(2).

  02  f pic x(5) value spaces.

  02  e-r pic z(2).

  02  f pic x(3) value spaces.

  02  e-int  pic z(4).z(2).

  02  f pic x(3) value spaces.

  02  e-tot pic z(6).z(2).

procedure division.

p-1.

  open output bankfile.

  perform g-w-para until ans = 'N' or 'n'.

  close bankfile.

  open input bankfile.

  display(1 1) erase.

  display head-1.

  display head-2.

  display head-1.

read-para.

  read bankfile at end go to close-para.

  if ( p not < 5000 and n not < 3 )

    move 10 to r

    compute tot = p * (1 +  r / 100) ** n.

  if ( p not < 5000 and n < 3)

    move 8 to r

    compute tot = p * (1 +  r / 100) ** n.

  if ( p < 5000)

    move 7 to r    

    compute tot = p * (1 + r / 100) ** n.

  move tot to e-tot.

  compute int = tot - p.

  move int to e- int.

  move dno to e-dno.

  move dname to e-dname.

  move p to e-p.

  move n to e-n.

  move r to e-r.

  display head-3.

  go to read-para.

close-para.

  display head-1.

  close bankfile.

  stop run.

g-w-para.

  display(1 1) erase.  

  display(3 5) "Dep No : ".

  accept dno.

  display(5 5) "Dep Name : ".

  accept dname.

  display(7 5) "Amount : ".

  accept p.

  display(9 5) "Years : ".

  accept n.

  write bankrec.

  display(15 5) "Add more [y/n] : ".

  accept ans.


Related Discussions:- Program to find interest on bank deposits

Blank when zero - edit characters for numeric data, BLANK WHEN ZERO: ...

BLANK WHEN ZERO: BLANK WHEN ZERO is an editing clause that may be used along with a picture. This will set the whole data item to blanks of its value is equal to zero. Though,

Rules for occurs clause, RULES FOR OCCURS CLAUSE: The rules apply for ...

RULES FOR OCCURS CLAUSE: The rules apply for the OCCURS clause and the subscripts are as shown below. (1) The integer in the OCCURS clause should be a positive integer.

Example of level numbers - cobol programming, Example of Level numbers - co...

Example of Level numbers - cobol programming: To explain the hierarchical structure introduced above, the concept of the level number is employed in COBOL. The most broad

Abbreviation of compound condition, Abbreviation: The Consecutive rela...

Abbreviation: The Consecutive relational conditions in a compound condition can be abbreviated in many cases as shown: (i) When the subjects in the consecutive relational c

Program for renames clause, PROGRAM FOR RENAMES CLAUSE: identification...

PROGRAM FOR RENAMES CLAUSE: identification division. program- id. environment division. data division. working-storage section. 01 emp.      02 empdet.

Program to demonstrate merge verb, PROGRAM TO DEMONSTRATE MERGE VERB: ...

PROGRAM TO DEMONSTRATE MERGE VERB: The two files for which a record having 2 fields viz. Account Number and Name are already available. Now Merge these two files and create a

Sequential file creation and rewriting, SEQUENTIAL FILE CREATION AND REWRIT...

SEQUENTIAL FILE CREATION AND REWRITING: We have to write a program to create a student file with just two fields: sno i.e. Student Number and same i.e. Student Name. Add a few

Programming Assignment, I need help with a COBOL programming assingment. I ...

I need help with a COBOL programming assingment. I have started the program but I need help completing the program. I have 5 errors. Here is the question. 10. Suppose your company

Rules of move verb, RULES OF MOVE VERB:  The Data movement is managed ...

RULES OF MOVE VERB:  The Data movement is managed by the rules which are as shown below: (a) The contents of the identifier - 1 or the value of the literal - 1 is moved to

Redefines clause , REDEFINES CLAUSE: At times it may be found that two...

REDEFINES CLAUSE: At times it may be found that two or more storage regions defined in the DATA DIVISION are not in use concurrently. In such situations only one storage regio

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd