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

+ 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: 3711

.

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

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

Attachments:

### Replies to This Discussion

Aliza ap ne error kesay theek kia? CS201 Assignment # 4 ; Due date 28 Jan 2013
Complete Working Solution..

Please change the some variable names...

Attachments:

file compile nahi ho rahi dost

Complete Solution.......

//////////////////////////Assignment NO .4 ///////////////////////////////////

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

using namespace std;

class Trapezoid{

public:
Trapezoid();
Trapezoid(float,float,float);
Trapezoid operator +(Trapezoid&);
void GetInput();
void SetBase1(float);
void SetBase2(float);
void SetHeight(float);
void display();
friend void CalculateArea(Trapezoid,Trapezoid);

private:
float base1,base2,height;
};
Trapezoid::Trapezoid()
{
base1 = 0.0;
base2 = 0.0;
height = 0;

}
Trapezoid::Trapezoid(float b1,float b2,float h)
{

base1 = b1;
base2 = b2;
height = h;

}
void Trapezoid::display()
{
coutendl;
cout"Base 1 = " base1endl;
cout"Base 2 = " base2endl;
cout"Height = " heightendl;
coutendl;
cout"Area of Trapezoid : "(base1+base2)/2*height;
}
void Trapezoid::SetBase1(float b1)
{
base1 = b1;

}
void Trapezoid::SetBase2(float b2)
{
base2 = b2;
}
void Trapezoid::SetHeight(float h)
{
height = h;
}

Trapezoid Trapezoid :: operator + (Trapezoid & trap)
{
Trapezoid temp;
temp.base1 = base1 + trap.base1;
temp.base2 = base2 + trap.base2;
temp.height = height + trap.height;
return temp;

}
void Trapezoid::GetInput()
{
float b1 = 0.0;
float b2 = 0.0;
float h = 0;
coutendl;
cout"Enter Base 1:";
cin>>b1;
cout"Enter Base 2:";
cin>>b2;
cout"Enter Height:";
cin>>h;
SetBase1(b1);
SetBase2(b2);
SetHeight(h);
}
void CalculateArea(Trapezoid b1,Trapezoid b2)
{
Trapezoid temp;
temp = b1 + b2;
temp.display();
}
int main()
{
Trapezoid b1;
Trapezoid b2;
coutendl;
cout"Enter Data for Object 1 :\n";
b1.GetInput();
cout"Enter Data for Object 2 :\n";
b2.GetInput();
CalculateArea(b1,b2);
getch();
}

Attachments:

## CS201 Assignmnt#4 solution

100% ok solution

#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <stdio.h>
using namespace std;
class trapezoid{
public:
trapezoid();
trapezoid(float,float,float);
trapezoid operator +(trapezoid&);
void getinput();
void set_base1(float);
void set_base2(float);
void set_hight(float);
void display();
friend void calculateArea(trapezoid,trapezoid);

private:
float base1,base2,hight;
};
trapezoid::trapezoid()
{
base1 = 0.0;
base2 = 0.0;
hight = 0;

}
trapezoid::trapezoid(float bs1,float bs2,float ht)
{
base1 = bs1;
base2 = bs2;
hight = ht;

}
void trapezoid::display()
{
cout"base 1: "base1endl;
cout"base 2: "base2endl;
cout"hight : "hightendl;
cout"The Eare of the Trapezoid is: "(base1+base2)/2*hightendl;
}

void trapezoid::set_base1(float bs1)
{
base1 = bs1;

}
void trapezoid::set_base2(float bs2)
{
base2 = bs2;
}
void trapezoid::set_hight(float ht)
{
hight = ht;
}

trapezoid trapezoid::operator+(trapezoid& trap)
{
trapezoid temp;
temp.base1 = base1 + trap.base1;
temp.base2 = base2 + trap.base2;
temp.hight = hight + trap.hight;
return temp;

}
void trapezoid::getinput()
{
float bs1 = 0.0;
float bs2 = 0.0;
float ht = 0;
cin>>bs1;
cin>>bs2;
cin>>ht;
set_base1(bs1);
set_base2(bs2);
set_hight(ht);
}
void calculateArea(trapezoid bs1,trapezoid bs2)
{
trapezoid temp;
temp = bs1 + bs2;
temp.display();

}
int main()
{
trapezoid bs1;
trapezoid bs2;
cout"Object {1}"endl;
bs1.getinput();
coutendl;
cout"Object {2}"endl;
bs2.getinput();
calculateArea(bs1,bs2);
_getch();

}

## CS201 Assignmnt#4 solution

100% ok solution

Attachments:

cout"base 1: "base1endl;
is line ma q error aa raha hy..??? :/

koi error ni hai. Thanks tariq bhai Jazaak ALLAH

Hello! Friends, anybody solved the CS201 Assignment 4 at his own?

I would like to understand full assignment step by step, if anybody could do, this will be a great help and i will appreciate that, thx in advance   