Homework
Homework
Homework
#include “stdafx.h”
#include<iostream>
class bank
string name;
int acc_no;
string type;
float balc;
int dep,wd;
public:
void input();
void withdraw();
void deposit();
void display();
};
cout << "Mr./Mrs " << name <<"! Enter your account number= "; cin >>acc_no;
cout << "Now enter the balance in your account= "; cin>>balc;
{
cout << "If you want to withdraw amount write Y! "; cin >> ch1;
if (ch1=='Y')
cout << "Enter the amount you want to Withdraw="; cin >>wd;
if(wd<balc)
else
cout << "If you want to deposit amount press Y! "; cin >>ch2;
if (ch2=='Y')
}
int main()
bank ep1;
ep1.input();
ep1.withdraw();
ep1.deposit();
ep1.display();
return 0;
Question 2
#include “stdafx.h”
#include <iostream>
class employee
string name;
int age;
string desig;
float salary;
public:
};
cout << "Enter your name here! "; cin >> e[i].name;
cout << "Please enter your Salary: "; cin >> e[i].salary;
string y;
int z;
z=e[0].salary;
y=e[0].name;
for(int i=1;i<10;i++)
if(e[i].salary>z)
z=e[i].salary;
y=e[i].name;
return 0;
cout << "Detail of " <<e[i].name <<endl <<e[i].age <<"\t" <<e[i].desig <<"\t" <<e[i].salary <<endl;
int main()
int x;
employee*arr=new employee[x];
int res;
arr[0].detail(arr,x);
employee call;
arr[0].output(arr,x);
res=call.max(arr,x);
return 0;
Question 3
#include "stdafx.h"
#include<iostream>
#include<string>
using namespace std;
class student
{
private :
int id;
double marks;
string name;
public:
void setter();
void getter();
double getmarks();
};
//***********************************************
void student :: setter()
{
cout<<" id "<<endl;
cin>>id;
cout<<" name "<<endl;
cin>>name;
cout<<" marks "<<endl;
cin>>marks;
}
cout<<id<<name<<marks<<endl;
//*************************************************************
cout<<"************************************************************
******"<<endl<<endl;
double var =0;
double total =0;
var= var/total;
return 0;
}