Professional Documents
Culture Documents
Problem Statement: Chainage (M)
Problem Statement: Chainage (M)
The following offsets are taken from a chain line to an irregular boundary towards right
side of the chain line.
Chainage 0
25
50
75
100
125
150
Offset
m
5.0
6.5
5.5
7.3
6.0
4.0
3.6
Compye the total area enclosed irregular boundary and the chain line using
a) Trapezoidal Rule
b) Simpsons 1/3 Rule
c) Simpsons 3/8 Rule
8
7
6
OFFSET (m)
5
4
3
2
1
0
0
25
50
75
CHAINAGE (m)
100
125
150
TRAPEZOIDAL RULE
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
float x[10],y[10],sum=0,h,temp;
int i,n,j,k=0;
float fact(int);
printf(" \t \t \t TRAPEZOIDAL RULE");
printf("\n \n Enter the number of observations: ");
scanf("%d",&n);
for(i=0; i<n; i++)
{
printf("\n Enter the value of chainage %d: ",i);
scanf("%f",&x[i]);
printf("\n\ Enter the value of offset %d im metres : ",i);
scanf("%f",&y[i]);
}
h=x[1]-x[0];
n=n-1;
for(i=0;i<n;i++)
{
if(k==0)
{
sum = sum + y[i];
k=1;
}
else
sum = sum + 2 * y[i];
}
sum = sum + y[i];
sum = sum * (h/2);
printf("\n \t ENCLOSED AREA = %f square metres ",sum);
getch();
}
else
{
sum = sum + 3 * y[i];
}
}
sum = sum + y[i];
sum = sum * (3*h/8);
printf("\n\n \t AREA ENCLOSED = %f square metres ",sum);
getch();
}