For the code below, you are requested to prepare a well-explained flowchart and the pseudocode. Note that the code below is a C program.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

For the code below, you are requested to prepare a well-explained flowchart and the pseudocode. Note that the code below is a C program.

#include<stdio.h>

#include<stdlib.h>

#include<conio.h>

void creation();

void deposit();

void withdraw();

void bal();

int a=0,i = 101;

struct bank

{

int no;

char name[20];

float bal;

float dep;

}s[20];

void main()

{

int ch;

while(1)

{

printf("\n*********************");

printf("\n BANKING ");

printf("\n*********************");

printf("\n1-Creation");

printf("\n2-Withdraw");

printf("\n3-Balance Enquiry");

printf("\n4-Deposit");

printf("\n5-Exit");

printf("\nEnter your choice");

scanf("%d",&ch);

switch(ch)

{

case 1: creation();

break;

case 2: deposit();

break;

case 3: withdraw();

break;

case 4: bal();

break;

case 5: exit(0);

defalut: printf("Enter 1-5 only");

getch();

}

}

}

void creation()

{

printf("\n*************************************");

printf("\n ACCOUNT CREATION ");

printf("\n*************************************");

printf("\nYour Account Number is :%d",i);

s[a].no = i;

printf("\nEnter your Name:");

scanf("%s",s[a].name);

printf("\nYour Deposit is Minimum Rs.500");

s[a].dep=500;

a++;

i++;

getch();

}

void deposit()

{

int no,b=0,m=0;

float aa;

printf("\n*************************************");

printf("\n DEPOSIT ");

printf("\n*************************************");

printf("\nEnter your Account Number");

scanf("%d",&no);

for(b=0;b<i;b++)

{

if(s[b].no == no)

m = b;

}

if(s[m].no == no)

{

printf("\n Account Number");

("%d",s[m].no);

printf("\n Name : %s",s[m].name);

printf("\n Deposit : %f",s[m].dep);

printf("\n How Much Withdraw Now:");

scanf("%f",&aa);

if(s[m].dep<aa+500)

{

printf("\nCANNOT WITHDRAW YOUR ACCOUNT HAS MINIMUM BALANCE");

getch();

}

else

{

s[m].dep-=aa;

printf("\nThe Balance Amount is:%f",s[m].dep);

}

}

else

{

printf("INVALID");

getch();

}

getch();

}

void bal()

{

int no,b=0,m=0;

float aa;

printf("\n*************************************");

printf("\n DEPOSIT ");

printf("\n*************************************");

printf("\nEnter your Account Number");

scanf("%d",&no);

for(b=0;b<i;b++)

{

if(s[b].no == no)

m = b;

}

if(s[m].no == no)

{

printf("\n Account Number : %d",s[m].no);

printf("\n Name : %s",s[m].name);

printf("\n Deposit : %f",s[m].dep);

printf("\n How Much Deposited Now:");

scanf("%f",&aa);

s[m].dep+=aa;

printf("\nDeposit Amount is :%f",s[m].dep);

getch();

}

else

{

printf("\nACCOUNT NUMBER IS INVALID");

getch();

}

}

void withdraw()

{

int no,b=0,m=0;

float aa;

printf("\n*************************************");

printf("\n BALANCE ENQUIRY ");

printf("\n*************************************");

printf("\nEnter your Account Number");

scanf("%d",&no);

for(b=0;b<i;b++)

{

if(s[b].no == no)

m = b;

}

if(s[m].no==no)

{

printf("\n Account Number : %d",s[m].no);

printf("\n Name : %s",s[m].name);

printf("\n Deposit : %f",s[m].dep);

getch();

}

else

{

printf("INVALID");

getch();

}

}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Types of Loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education