Perimeter
Hello guys now i want to share the
program about Formula to find the area in C++. Before we jump to the code
i will tell u something. The first time my coding in here was just for help the
other to make easy the job or a homework. A little about our topic today to
opening the code.
The perimeter of a plane figure is that
the distance round the outside of the plane figure.
A plane figure is 2-dimensional; but, perimeter is 1-dimensional
and is measured in linear units. to
assist America create this
distinction,scrutinize our image of an oblong grounds.
The yard is 2-dimensional: it's a length and a breadth. the
number of fence required to
surround the grounds (perimeter) is 1-dimensional. The perimeter
of this yard is that the distanceround the outside of the yard,
indicated by the red arrow; it's measured in linear
units like feet or meters.
To find the perimeter of a plane figure,
take the add of the length of every facet. The polygons
below area unitabundant smaller than a fenced-in yard. Thus, we
have a tendency to use smaller units in our examples, likecentimeters
and inches.
Example 1: Find
the perimeter of a triangle with
sides measurement five centimeters, nine
centimeters and elevencentimeters.
Solution: P = five cm + nine cm
+ eleven cm = twenty five cm
Example 2: A parallelogram contains
a length of eight centimeters and a breadth of
three centimeters. realize the perimeter.
Solution 1: P = eight cm + 8cm
+ three cm + three cm = twenty two cm
Solution 2: P = 2(8 cm) + 2(3 cm)
= sixteen cm + six cm = twenty two cm
In
Example two, the
second answer is additional unremarkably used. In
fact, in arithmetic, we have a tendency
tounremarkably use the subsequent formula for perimeter of a
rectangle:
P =2L + 2W, wherever P is that the perimeter, L is
that the length and W is that the breadth.
In the next
few examples, we are going to realize the perimeter
of different polygons.
Example 3: Find the perimeter of
a sq. with both sides measurement two inches.
Solution: P = two in + two in
+ two in + two in = eight in
Example four: Find the perimeter of associate
degree regular polygon with both sides
measurement 4 centimeters.
Solution: P = four cm + four cm
+ four cm = twelve cm
A sq. associate degreed an regular polygon area
unit each samples of regular polygons. Another technique for
locating the perimeter of a daily plane figure is to
multiply the quantity of facets by the length of
1 side. Let's come
back Examples three and four exploitation this
second technique.
Example 3: Find the perimeter of
a sq. with both sides measurement two inches.
Solution:
This isogon has four sides, every with a
length of two inches. so we have a tendency to get:
P = 4(2 in) = eight in
Example four: Find the perimeter of associate
degree regular polygon with both sides measurement 4
centimeters.
Solution:
This isogon has three sides, each with a length of 4
centimeters. Thus we get:
P = 3(4 cm) = 12 cm.
Example 5: Find the perimeter of a regular
pentagon with each side measuring 3 inches.
Solution: P = 5(3 in) = 15 in
Example 6: The perimeter of a
regular polygon is eighteen centimeters. How long is one
side?
Solution: P = 18 cm
Let s
represent the length of one side. a
daily polygon has six sides, therefore we
will divide the perimeter by six to urge the length of
1 facet (s).
s = eighteen cm ÷ six
s = 3 cm
Summary: To realize the perimeter of a plane figure, take
the add of the length of every facet. The formula for
perimeter of a parallelogram is: P = 2L + 2W. to seek
out the perimeter of a daily plane figure, multiply the
quantityof facets by the length of 1 side.
Example the code in c++:
#include <iostream>
#include <conio.h>
using namespace std;
int main (){
float
a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;
cout<<"Formula
to find the area"<<endl;
cout<<"\t1. Rectangle"<<endl;
cout<<"\t2. Square"<<endl;
cout<<"\t3. Circle"<<endl;
cout<<"\t4. Rhombus"<<endl;
cout<<"\t5. Kite"<<endl;
cout<<"\t6. Trapezoid"<<endl;
cout<<"\t7. Triangle"<<endl;
cout<<"---------------------------------"<<endl;
cout<<"Choose the number u want= ";
cin>>a;
if (a==1){
cout<<"Please fill the long with number = ";
cin>>b;
cout<<"Please fill the width with number = ";
cin>>c;
d=b*c;
cout<<"The area Rectangle is = "<<d;
}else if
(a==2){
cout<<"Please fill the width with number = ";
cin>>e;
f=e*e;
cout<<"The area square is= "<<f;
}else if
(a==3){
cout<<"Please fill the radius with number = ";
cin>>g;
h=3.14*g*g;
cout<<"The area circle is = "<<h;
}else if
(a==5){
cout<<"Please fill D1 with number = ";
cin>>i;
cout<<"Please fill D2 with number = ";
cin>>j;
k=0.5*i*j;
cout<<"The area kite is = "<<k;
}else if
(a==4){
cout<<"Please fill pedestal of parallelogram with number = ";
cin>>l;
cout<<"Please fill the height with number = ";
cin>>m;
n=l*m;
cout<<"The area rhombus is = "<<n;
}else if
(a==6){
cout<<"Please fill the same side with number = ";
cin>>o;
cout<<"Please fill the height with number = ";
cin>>p;
q=0.5*o*p;
cout<<"The area trapezoid is = "<<q;
}else if
(a==7){
cout<<"Please fill the pedestal of triangle with number = ";
cin>>r;
cout<<"Please fill the hieght with number = ";
cin>>s;
t=0.5*r*s;
cout<<"The area triangle is = "<<t;
}else {
cout<<"Sorry your number is wrong";
}
cout<<endl;
cout<<endl;
cout<<"-----------------------------------------"<<endl;
cout<<"\tCreated by Hsep 7"<<endl;
cout<<"\tI'am fron Indonesia"<<endl;
cout<<"\tI'am
study in Amikom Yogyakarta"<<endl;
cout<<"\tIf u have a project"<<endl;
cout<<"\tU can send me a message"<<endl;
cout<<"\tmirorforce@gmail.com"<<endl;
cout<<"\tOr u can contact amikom.ac.id to find me"<<endl;
cout<<"------------------------------------------"<<endl;
getch ();
return 0;
}
In the compiler was write
Formula to find the area
1.
Rectangle
2.
Square
3.
Circle
4.
Rhombus
5.
Kite
6.
Trapezoid
7.
Triangle
-------------------------------------------------------
Choose the number u want = 1
please fill the long with number = 41
please fill the width with number = 41
The area Rectnagle is = 2091
------------------------------------------
Createdby Hsep
7
I'am from
Indonesia
I'am study in
Amikom Yogyakarta
If u have a
project
U can send me
message
mirorforce@gmail.com
Or u can
contact amikom.ac.id
-------------------------------------------
Belum ada tanggapan untuk "Formula to find the area C++"
Posting Komentar