Você está na página 1de 3

Topic:-Banking System

A Design Problem

Submitted To:Ms.Darvinder Kaur

Submitted By:Arun Thakur Roll No. RK3R13B21 Reg. No. 11003400

Coding For Banking System:#! /bin/bash echo "||||||||||||*Welcome To The Punjab National Bank*||||||||||||" accno=0 while((a!=5)) do echo -e "Enter Your choices" echo -e "1.New Account" echo -e "2.Withdrawl" echo -e "3.Deposit" echo -e "4.Balance Enquiry" echo -e "5.Exit" read a case $a in 1)accno=`cat info1.txt` accno=`expr $accno + 1 |bc` echo "Enter your name" read b echo "Enter amount to deposit" read am echo "Enter your age" read age echo "Enter your contact Number" read con echo "$accno $b $am $age $con" | cat >>info.txt echo $accno | cat >info1.txt echo "Your account is Successfully opened" echo "Name:$b" echo "Age:$age" echo "Balance:$am" echo "Contact No:$con" echo "accno:$accno" echo "Thank You";; 2) echo "Enter your account number" read accno accno1=`cat info1.txt` if test $accno -le $accno1 then echo "Enter ammount:" read amount else echo "Account number is wrong" fi temp=`grep $accno info.txt` j=0 for i in $temp do if test $j -eq 2 then balance=`echo $i` fi j=`expr $j + 1 |bc` done if test $amount -le $balance then balance1=`expr $balance - $amount |bc` echo $temp |cat >info2.txt

temp1=`sed s/$balance/$balance1/g info2.txt` temp1=`sed s/"$temp"/"$temp1"/g info.txt` echo $temp1 |cat >info.txt echo "withdrawl successful" else echo "Insufficient Amount" fi;; 3) echo "Enter your account number" read acno acno1=`cat info1.txt` if test $acno -le $acno1 then echo "Enter Amount:" read amm else echo "Account number is wrong" fi temp3=`grep $acno info.txt` l=0 for c in $temp3 do if test $l -eq 2 then balance=`echo $c` fi l=`expr $l + 1 |bc` done bal1=`expr $balance + $amm |bc` echo $temp3 |cat >info2.txt temp4=`sed s/$balance/$bal1/g info2.txt` temp3=`sed s/"$temp3"/"$temp4"/g info.txt` echo $temp4 |cat >info.txt echo "Transaction Successful";; 4) echo "Enter your account number" read ac ac1=`cat info1.txt` if test $ac -le $ac1 then tem=`grep $ac info.txt` p=0 for n in $tem do if test $p -eq 2 then balance=`echo $n` fi p=`expr $p + 1 |bc` done echo "Balance is:$balance" fi;; esac done

Você também pode gostar