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

# Correct and Final Solution of Assignment No.4 Of CS201 Due Date 28 Jan 2013 Solved by Waqas Rasheed

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

.

+ 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

1. C program or source code for find area of trapezium
2. How to calculate area of trapezium in c programming language

#include <stdio.h>
int main(){
float height,base1,base2;
float area;
printf("Enter the height of the trapezium: ");
scanf("%f%",&height);
printf("Enter length of lower base of the trapezium: ");
scanf("%f%",&base1);
printf("Enter length of upper base of the trapezium: ");
scanf("%f%",&base2);
area = 0.5 * (base1 + base2) * height;
printf("Area of trapezium is: %f",area);
return 0;
}

Now all details and relent material of this is assignment is here....

Now just read objectives of this assignment

• Objects and Classes
• Constructors and Destructors in classes
• Setters and Getters in classes
• Use of friend functions

C program for find area of trapezium

and prepare assignment according to requirements...................

Enjoy

galti ho gai ya subject repet lay kr :(

Trapezium is a quadrilateral with two parallel sides. The Area of a trapezium is equal to the average length of the two parallel side multiply by the height.

In this example you will learn how to create an application from a given formula and write a simple program that will accept input or data from the user.

Code

#include <iostream>
using namespace std;

int main()
{
int parallelsidea;
int parallelsideb;
int height;
int Area;

cout  "Enter the length of the first parallel side: ";
cin >> parallelsidea;

cout endl  "Enter the length of the second parallel side: ";
cin >> parallelsideb;

cout endl  "Enter the height: ";
cin >> height;

Area = (parallelsidea + parallelsideb) / 2 * height;

cout endl  "Area of the Trapezoid: "  Area endl;
system("pause");

return 0;

}

Q.As in assignmment

"

• Implement a default constructor to initialize all data members with zero and a parameterized constructor which takes three arguments to initialize data members of class.
• Take input from user for base1, base2 and height of 2 objects."
So
why we have to declare two constructor as one is enough. and is we have to create two objects using new operator?
As instructed in the assignment, you have to implement a parameterized constructor as well with a default constructor.
Moreover it is up to you to create objects with new operator or you simply declare two objects of the given class.
It is not necessary to use new operator.

ya sab kia ha???

Sabaq.........!

Function mea program kesy likha jata hy?????

Following is a simple program that adds two integers using a function named addition. We pass both numbers as arguments to the function and the function performs the addition.

#include <iostream.h>
using namespace std;
int addition (int a, int b)

int r;
r=a+b;
return (r);

int main ()

int z;
cout "The result is " z;
return 0;
}

waqas bhai itnay error niklay hain

send me file

Ha Ha ha ha,  Rock sahb ap ne to assignment ki khaal hi utar k rakh di.

wese I think Waqas bhai ka code ok he ap s koi mistake hui ho gi.

mai ne compile kar k dekha d hai output ab ye sab dekh k b theek nahi likhtey...

to kya karen

## Latest Activity

43 seconds ago
1 minute ago
Shahzaib hussain joined + M.Tariq Malik's group

### MGT502 Organizational Behavior

1 minute ago
1 minute ago
Bint-e-Adam liked ♦_"Tooba"_♦'s discussion "Khamosh Ho Jana"
3 minutes ago
4 minutes ago
+!!! illegal weapon !!! liked иαвєєℓ αнмє∂'s discussion !!!!!Guftagu!!!!!!
4 minutes ago
Biya and + ! ! AɳƓєℓ ❥ are now friends
7 minutes ago
Alone Struggler posted discussions
16 minutes ago
47 minutes ago
53 minutes ago

1

2