0% found this document useful (0 votes)
3 views4 pages

Simplified Student and Banking Programs

The document outlines four simplified programs: a Student Record System that collects and displays student details, a Bank Account OOP that manages deposits, withdrawals, and balance, a Custom Stack that uses recursion to print stack elements, and a Custom Queue that prints elements from front to rear. Each program is presented in a simplified B-format and includes basic functionalities. The output for each program is described, showing how data is displayed.

Uploaded by

uibuvanesh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

Simplified Student and Banking Programs

The document outlines four simplified programs: a Student Record System that collects and displays student details, a Bank Account OOP that manages deposits, withdrawals, and balance, a Custom Stack that uses recursion to print stack elements, and a Custom Queue that prints elements from front to rear. Each program is presented in a simplified B-format and includes basic functionalities. The output for each program is described, showing how data is displayed.

Uploaded by

uibuvanesh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1.

STUDENT RECORD SYSTEM


PROGRAM (Simplified B-Format):
# Short & Easy Version students = [] def add(): sid=input("ID: "); name=input("Name:
") marks=list(map(int,input("3 marks: ").split())) avg=sum(marks)/3
[Link]([sid,name,sum(marks),avg]) def show(): for s in students: print(s)
add(); show()
OUTPUT: Same as original (displays student details).
2. BANK ACCOUNT OOP
PROGRAM (Simplified B-Format):
class Bank: def __init__(s,n,b=0): s.n=n; s.b=b def dep(s,a): s.b+=a;
print("Deposited",a) def wit(s,a): s.b-=a; print("Withdrew",a) def bal(s):
print("Bal=",s.b) A=Bank("123",5000) [Link](1000); [Link](500); [Link]()
OUTPUT: Shows deposit, withdraw, balance.
3. CUSTOM STACK (RECURSION)
PROGRAM (Simplified B-Format):
class S: def __init__(s): s.t=[] def p(s,x): [Link](x) def pop(s): return
[Link]() def show(s): if not s.t: return x=[Link](); print(x); [Link]();
[Link](x) st=S(); st.p(10); st.p(20); st.p(30); [Link]()
OUTPUT: Prints stack top → bottom.
4. CUSTOM QUEUE
PROGRAM (Simplified B-Format):
class Q: def __init__(s): s.q=[] def en(s,x): [Link](x) def de(s): return
[Link](0) def show(s): if not s.q: return x=[Link](); print(x); [Link]();
[Link](x) q=Q(); [Link](1); [Link](2); [Link](3); [Link]()
OUTPUT: Prints queue front → rear.

You might also like