>accno; cout<<"Enter Acco : Notes">

NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
class Account
{
char name[20];
int accno;
char atype;
public:
void getAccountDetails()
{
cout<<"Enter namen";
gets(name);
cout<<"Enter Account Numbern";
cin>>accno;
cout<<"Enter Account Typen";
cin>>atype;
}
void displayDetails()
{
cout<<"Name : "<<name<<endl;
cout<<"Account Number : "<<accno<<endl;
cout<<"Account Type : "<<atype<<endl
;
}
};
class Current_Account:public Account
{
int c_balance;
public:
Current_Account(){c_balance=1000;}
void c_display()
{
cout<<"Available Balance:"<<c_balance<<endl;
}
void c_deposit()
{
int cb;
cout<<"Enter the amount to be deposited"<<endl;
cin>>cb;
c_balance+=cb;
}
void c_withdraw()
{
int cw;
cout<<"Enter the amount to be withdrawal"<<endl;
cin>>cw;
if(c_balance>1000)
c_balance-=cw;
else
cout<<"Insufficient Balance"<<endl;
}
};
class Saving_Account:public Account
{
int s_balance;
public:
Saving_Account(){s_balance=500;}
void s_display()
{
cout<<"Available Balance:"<<s_balance<<endl;
}
void s_deposit()
{
int sb;
cout<<"Enter the amount to be deposited"<<endl;
cin>>sb;
s_balance+=sb;

}
void s_withdraw()
{
int sw;
cout<<"Enter the amount to be withdrawal"<<endl;
cin>>sw;
if(s_balance>500)
s_balance-=sw;
else
cout<<"Insufficient Balance"<<endl;
}
};
void main()
{
Current_Account c;
Saving_Account s;
char atype;int choice;
cout<<"Choose the type of AccountnS or s for Saving Accountn";
cout<<"C or c for Current Accountn";
cin>>atype;
if(atype=='s'||atype=='S')
{
s.getAccountDetails();
s.displayDetails();
while(1)
{
cout<<"1.Check Balancen2.Depositn3.Withdrawn4.Exitn";
cin>>choice;
switch(choice)
{
case 1: s.s_display();break;
case 2: s.s_deposit();break;
case 3: s.s_withdraw();break;
case 4: goto out;
default: cout<<"Invlid Choice...Try Again";
}
}
}
else if(atype=='c'||atype=='C')
{
c.getAccountDetails();
c.displayDetails();
while(1)
{
cout<<"1.Check Balancen2.Depositn3.Withdrawn4.Exitn";
cin>>choice;
switch(choice)
{
case 1: c.c_display();break;
case 2: c.c_deposit();break;
case 3: c.c_withdraw();break;
case 4: goto out;
default: cout<<"Invlid Choice...Try Again";
}
}
}
else
{
cout<<"Invalid Type of Account...Visit Again!!!";
}
out:
cout<<"nThank you for Banking with us.......";
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.