Posts

Write Cpp program to represent bank account using member function

Define a class to represent a bank account which include following member data member:- 1)name 2)Account number 3)type of account 4)bal.amt member function: a.to assign initial value b.to deposit an account c.to withdraw an account d.to display name,account number and balance #include<conio.h> #include<iostream.h> #include<string.h> int w_amt; class bank { public:int acc_no,bal; char type[30],name[30]; public:void assign()        {        strcpy(name,"Vijay");        acc_no=111;        strcpy(type,"saving");        bal=12000;        }        void deposit()        {        int amt;        cout<<"\n Enter the amount which you want to deposi...

Cpp program to create class telephone to search no name and city

Create a class telephone containing name,telephone number and city as data members and write necessary member function for the following -search the telephone number with given name. -search the name with given telephone number -search all customer in a given city. #include<iostream.h> #include<conio.h> #include<string.h> class telephone { public:char name[30],city[30];        int tno; public:void get()        {        cout<<"enter name:-";        cin>>name;        cout<<"\nenter telephone number";        cin>>tno;        cout<<"\nenter city name:-";        cin>>city;        }        void search(int tnum)      ...