We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

# www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

1 assignment soulation file

#include <iostream>
#include <stdlib.h>

using namespace std;
//starting the student class
class Student {

private:
char * StudentID;
char * StudentName;

public:
Student(char *, char *);
void print(); //parametarized constructor of student class
~Student(); //destructor of student class

};

Student::Student(char *id, char *name) {
StudentID = id;
StudentName = name;
}

void Student::print() {
cout "Student ID :" StudentID endl;
cout "Student Name :" StudentName "\n\n";
}

Student::~Student() {

}

class Instructor{
private:
float age;

public:
Instructor(){ }
~Instructor(){ }
void input();
void print();
};

void Instructor::input() {

int i;

for(i=1; i<=8; i++) {
cout "Please enter the age of " i " Instructor in Feet : ";
cin >> age[i];
cout "\n\n";
}
}

void Instructor::print() {
int i;
float totalage = 0, averageage = 0;

for(i=1; i<=8; i++) {
totalage+=age[i];
}
averageage = totalage/8;
cout "Average Height in Feet : " averageage;
}

int main() {

Student student1((char *)"mc000000", (char *)"XYZ");
student1.print();

Instructor heights;
heights.input();
heights.print();

cout "\n\n";

system("pause");
}

2nd assign  soluation:

#include <iostream>
#include <stdlib.h>
using namespace std;

// Account Class Declaration and Definition
class account
{
private:
int accountNo;
float balance;
string bankName;
int b_code;
public:
account()
{
// Default Constructor
accountNo=00;
balance=0.0;
bankName="Default";
b_code=00;
}
// End of Default Constructor

account(int ac_num, float bal, string b_name, int code)
{
// Parametarized Constructor
accountNo=ac_num;
balance=bal;
bankName=b_name;
b_code= code;
}
// End Parametarized Constructor

void withdraw(float draw_money)
{
// WithDrawl Func
if (balance<draw_money){
cout "\n\a \"Insufficient balance.......\"";
}
else
{
balance-=draw_money;
}
}
// End of WithDrawl Func

{
// Deposit Func
}
// And other some self explanatory Function of Account Class
float getBalance()
{
return balance;
}
int getAccountNo()
{
return accountNo;
}
string getBankName()
{
return bankName;
}
int getBrachCode()
{
return b_code;
}
};
// End of Account Class

class customer
{
private:
string name;
public:
account ac; // public because it is represented as public in class diagram
customer(string n, string a, account acc){ // Parametarized Constructor
name= n;
ac=acc;
}
// End of Parametarized Constructor

void display()
{
cout "\n Customer Name: "name;
cout "\n Bank Name: "ac.getBankName();
cout "\n Branch Code: "ac.getBrachCode();
cout "\n Current Balance: "ac.getBalance();
cout "\n Account No. "ac.getAccountNo();
}
};
// End of Customer Class

main()
{
cout "..........Displaying Customer Account Information........."endlendl;
account myaccount(7876, 40100, "Habib Bank", 123); // Creating an account Obj
customer DD("XYZ", "Programming Island", myaccount); // Creating an customer Obj
DD.display();

float dep, draw;
cout "\n\n Please Enter a value for Deposit: ";
cin >> dep;
DD.ac.deposit(dep);
cout "\n\n Current Balance after Depositing...";
DD.display();

cout "\n\n Please Enter a value for Withdrawl: ";
cin >> draw;
DD.ac.withdraw(draw);
cout "\n\n Current Balance after withdrawing...";
DD.display();

cout endlendl;
system("pause");
}

3rd Assignment solutaion files:

#include <iostream>
using namespace std;
class Account
{
protected:
int account_no;
int balance;
char *bank_name;
int branch_code;
int rate_of_interest;

public:
Account(int v , int w , char *x , int y , int z)
{
account_no = v;
balance = w;
bank_name = x;
branch_code = y;
rate_of_interest = z;
}
void setBlance(int bln)
{
balance = bln;
}

int getBalance()
{
return balance;
}
int getInterRate()
{
return rate_of_interest;
}
virtual void calcProfit() = 0;

};

class currentAccount : public Account
{

public:
currentAccount(int v , int w , char *x , int y , int z =0):Account(v,w,x,y,z)
{

}
void calcProfit()
{
int pro = (balance*rate_of_interest)/100;
int Balance = balance + pro;
cout"Profit: 0 Balance: "Balanceendl;
}
};

class savingAccount : public Account
{
public :
savingAccount(int v , int w , char *x , int y , int z ):Account(v,w,x,y,z)
{

}
void calcProfit()
{
int pro = (balance*rate_of_interest)/100;
int Balance = balance + pro;
cout"Profit: "balance" Balance before profit "balance" Balance after profit "Balanceendl;
}
} ;
main ()
{

currentAccount a(01, 10000, "UBL", 123);
currentAccount b(01, 15000, "HBL", 111);
savingAccount c(02, 15000, "HBL", 111, 10) ;
savingAccount d(02, 10000, "UBL", 123, 15);
currentAccount e(03, 25000, "HBL", 111);

Account *obj;

obj = &a;
obj = &b;
obj = &c;
obj = &d;
obj = &e;
for(int i = 0 ; i< 5; i++)
{
obj[i]->calcProfit();
coutendl;
}
coutendl;
system("pause");
}

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 383

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

### Replies to This Discussion

there is some more things

Attachments:

file without error

Attachments:

midterm material

Attachments:

good job Pari. thanks for sharing