Beruflich Dokumente
Kultur Dokumente
ABDUR RAHMAN U N I V E R S I T Y
ENROLMENT No. COURSE TITLE STUDY CENTRE NAME NAME B. Tech. in Mechanical Engineering B.S.ABDUR RAHMAN UNIVERSITY
DATE:
COURS E CODE
BTME
CENTR E CODE
SIGNATURE
Date :
Lab In Charge
The Practical examination for COMPUTER PROGRAMMING CAD/CAM LABORATORIES (BMEL 003) is held on date.
Internal Examiner
External Examiner
2
INDEX
EX. No
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
DATE
PAGE No
Experiment No: 1
Date:
.11
Experiment No: 1
Date:
.11
Program: /*Program for addition and multiplication*/ #include<stdio.h> #include<string.h> #include<math.h> #include<conio.h> main() { clrscr(); printf("\t\t\tProgram for addition & multiplication\n"); printf("\t\t----------------------------------\n") ; int first,second,third,add,mul; printf("Enter first number:"); scanf("%d",&first); printf("\nEnter second number:"); scanf("%d",&second); printf("\nEnter third number:"); scanf("%d",&third); add=first+second+third; mul=first*second*third; printf("\nThe sum of numbers =%d",add); printf("\nThe product of numbers =%d\n",mul);
getch(); }
Experiment No: 1
Date:
.11
Result: Program for addition & multiplication ------------------------------------Enter first number:25 Enter second number:30 Enter third number:50 The sum of numbers =105 The product of numbers =37500
Experiment No: 2
Date:
.11
Experiment No: 2
Date:
.11
Experiment No: 2
Date:
.11
Experiment No: 3
Date:
.11
Experiment No: 3
Date:
.11
avg=sum/n;
Experiment No: 3
Date:
.11
Experiment No: 4
Date:
.11
Then the program is checked for various input & found satisfied. Finally the output is shown in the screen.
Experiment No: 4
Date:
.11
printf("\t\t-------------------------------------------------\n"); int l,b,area,perimeter; printf("Enter the Length of the Rectangle:"); scanf("%d",&l); printf("\nEnter the Breadth of the Rectangle:"); scanf("%d",&b); area=l*b; perimeter=2*(l+b); printf("\nThe Area of the Rectangle =%d\n", area); printf("The Perimeter of the Rectangle =%d\n",perimeter); getch(); } Experiment No: 4 Date: . .11
The Area of the Rectangle =6000 The Perimeter of the Rectangle =320
Experiment No: 5
Date:
.11
Procedure: Open C++ program windows by using Turbo C++ Software. The standard coding like stdio.h, math.h have been set. The variables are specified as required. By using printf & scanf command, the inputs are set in program. Then formula is given to find out the given geometrical part. By using printf command the output is set in program. Finally the program ends. By using Ctrl + F9 key, the program has been executed. Then the program is checked for various input & found satisfied. Finally the output is shown in the screen.
Experiment No: 5
Date:
.11
Experiment No: 5
Date:
.11
Experiment No: 6
Date:
.11
Experiment No: 6
Date:
.11
int i,n,total,name,mark; float avg; printf("Enter Student's name:"); scanf("%s",&name); printf("\nEnter Total Number of Subjects:"); scanf("%d\n",&n); total=0; for(i=1;i<=n;i++) { printf("Enter Subject %d Mark =",i); scanf("%d",&mark); if(mark<40) printf("\t\t\t\tSubject %d FAIL\n",i); Experiment No: 6 Date: . .11
Program for finding Students Mark system --------------------------------------Enter Students name: RAGUNATH P Enter Total Number of Subjects:5 Enter Subject 1 Mark =85 Subject 1 PASS Enter Subject 2 Mark =70 Subject 2 PASS Enter Subject 3 Mark =35 Subject 3 FAIL Enter Subject 4 Mark =75 Subject 4 PASS Enter Subject 5 Mark =30 Subject 5 FAIL Total Marks =295
Experiment No: 7
Date:
.11
Open C++ program windows by using Turbo C++ Software. The standard coding like stdio.h, math.h have been set. The variables are specified as required. By using printf & scanf command, the inputs are set in program. Then formula is given to find out the given geometrical part. By using printf command the output is set in program. Finally the program ends. By using Ctrl + F9 key, the program has been executed. Then the program is checked for various input & found satisfied. Finally the output is shown in the screen.
Experiment No: 7
Date:
.11
Program: /*Program for finding the biggest numbers among the three numbers */ #include<stdio.h> #include<string.h> #include<math.h> #include<conio.h> main() { clrscr(); printf("t\t\tProgram for finding the Biggest Number\n"); printf("\t\t-------------------------------\n"); int a,b,c; printf("Enter the three numbers:"); scanf("%d %d %d",&a,&b,&c); if(a>b) { if(a>c) { printf("\n%d is the Biggest Number",a); } else printf("\n%d is the Biggest Number",c); }
Experiment No: 7
Date:
.11
Experiment No: 8
Date:
.11
Then the program is checked for various input & found satisfied. Finally the output is shown in the screen.
Experiment No: 8
Date:
.11
printf("\t\t------------------------------------\n"); float radius,circum; float pi=3.14; printf("Enter the Radius of the Circle:"); scanf("%f",&radius); circum=2*pi*radius; printf("\nThe Circumference = %f\n",circum); getch(); }
Experiment No: 8
Date:
.11
Experiment No: 9
Date:
.11
Open C++ program windows by using Turbo C++ Software. The standard coding like stdio.h, math.h have been set. The variables are specified as required. By using printf & scanf command, the inputs are set in program. Then formula is given to find out the given geometrical part. By using printf command the output is set in program. Finally the program ends. By using Ctrl + F9 key, the program has been executed. Then the program is checked for various input & found satisfied. Finally the output is shown in the screen.
Experiment No: 9
Date:
.11
Experiment No: 9
Date:
.11
Experiment No: 10
Date:
.11
By using Ctrl + F9 key, the program has been executed. Then the program is checked for various input & found satisfied. Finally the output is shown in the screen.
Experiment No: 10
Date:
.11
printf("\t\t----------------------------------------------\n"); int n; float a1,a2,a3,x1,x2,x3,centroid1,centroid 2, centroid3; printf("Enter the Number of Sections:"); scanf("%d",&n); { printf("\nEnter the Area of First Section:"); scanf("%f",&a1); printf("\nEnter the Area of Second Section:"); scanf("%f",&a2); printf("\nEnter the Area of Third Section:"); scanf("%f",&a3);
Experiment No: 10
Date:
.11
scanf("%f",&x3); centroid1=(a1*x1)/a1; centroid2=(a1*x1+a2*x2)/(a1+a2); centroid3=(a1*x1+a2*x2+a3*x3)/ (a1+a2+a3); printf("\n\nThe Centriod of 1 Section =%f", centroid1); printf("\nThe Centriod of 2 Section =%f", centroid2); printf("\nThe Centriod of 3 Section =%f", centroid3); } getch(); }
Experiment No: 10
Date:
.11
--------------------------------------------Enter the Number of Sections:3 Enter the Area of First Section:750 Enter the Area of Second Section:830 Enter the Area of Third Section:600 Enter the X1 Value:80 Enter the X1 Value:100 Enter the X1 Value:150 The Centriod of 1 Section =80.000000 The Centriod of 2 Section =90.506332 The Centriod of 3 Section =106.880737
Experiment No: 11
Date:
.11
To write a C++ program to find the centroid of an I section. Software Used: Turbo C++ Procedure: Open C++ program windows by using Turbo C++ Software. The standard coding like stdio.h, math.h have been set. The variables are specified as required. By using printf & scanf command, the inputs are set in program. Then formula is given to find out the given geometrical part. By using printf command the output is set in program. Finally the program ends. By using Ctrl + F9 key, the program has been executed. Then the program is checked for various input & found satisfied. Finally the output is shown in the screen.
Experiment No: 11
Date:
.11
printf("Enter the Length & Breadth of Rectangle a2=l2*b2; of Section 2 ="); scanf("%f %f",&l2,&b2);
Experiment No: 11
Date:
.11
Experiment No: 11
Date:
.11
Enter the Length & Breadth of Rectangle of Section 2 =20 80 The Area of Rectangle of Section 2 =1600.000000 Enter the Length & Breadth of Rectangle of Section 3 =100 20 The Area of Rectangle of Section 3 =2000.000000 Enter X Values Enter X1 Value:10 Enter X2 Value:50 Enter X3 Value:80 Experiment No: 11 Date: .
.11
Y-axis =38.571430
Experiment No: 12
Date:
.11
The standard coding like stdio.h, math.h have been set. The variables are specified as required. By using printf & scanf command, the inputs are set in program. Then formula is given to find out the given geometrical part. By using printf command the output is set in program. Finally the program ends. By using Ctrl + F9 key, the program has been executed. Then the program is checked for various input & found satisfied. Finally the output is shown in the screen.
Experiment No: 12
Date:
.11
/*Program For Creating A Line For The Given Points*/ #include<stdio.h> #include<stdlib.h> #include<conio.h> #include<graphics.h> main() { clrscr(); printf("t\t\tProgram for creating a line for the given points\n"); printf("\t\t------------------------------------------------\n"); int xmin,xmax,ymin,ymax; printf("Graphics driver initialization - Please include the C program directory\n"); int gdriver=DETECT,gmode,errorcode; initgraph(&gdriver,&gmode,"C:\TC"); setcolor(BLUE); printf("Enter X start point:"); scanf("%d",&xmin); printf("\nEnter Y start point:"); scanf("%d",&ymin); printf("\nEnter X end point:"); scanf("%d",&xmax); Experiment No: 12 Date: .
.11
printf("\nEnter Y end point:"); scanf("%d\n",&ymax); line(xmin,ymin,xmax,ymax); getch(); closegraph(); } Result: Program For Creating A Line For The Given Points ----------------------------------------------Enter X start point:50 Enter Y start point:20 Enter X end point:20 Enter Y end point:20
Experiment No: 13
Date:
.11
Experiment No: 13
Date:
.11
initgraph(&gdriver,&gmode,"C:\TC"); setcolor(RED); printf("Enter A point:"); scanf("%d",&A); printf("\nEnter B point:"); scanf("%d",&B); printf("\nEnter C point:"); scanf("%d",&C); printf("\nEnter D point:"); scanf("%d\n",&D); rectangle(A,B,C,D); Experiment No: 13 Date: .
.11
Experiment No: 14
Date:
.11
By using printf command the output is set in program. Finally the program ends. By using Ctrl + F9 key, the program has been executed. Then the program is checked for various input & found satisfied. Finally the output is shown in the screen.
Experiment No: 14
Date:
.11
printf("t\t\tProgram for Creating Circle\n"); printf("\t\t---------------------------\n"); int xcenter,ycenter,radius; printf("Graphics driver initialization - Please include the C program directory\n"); int gdriver=DETECT,gmode,errorcode; initgraph(&gdriver,&gmode,"C:\TC"); setcolor(GREEN); printf("Enter center point:"); scanf("%d %d",&xcenter,&ycenter); printf("\nEnter radius of circle:"); scanf("%d\n",&radius); circle(xcenter,ycenter,radius); getch(); closegraph(); }
Experiment No: 14
Date:
.11
Experiment No: 15
Date:
.11
Open C++ program windows by using Turbo C++ Software. The standard coding like stdio.h, math.h have been set. The variables are specified as required. By using printf & scanf command, the inputs are set in program. Then formula is given to find out the given geometrical part. By using printf command the output is set in program. Finally the program ends. By using Ctrl + F9 key, the program has been executed. Then the program is checked for various input & found satisfied. Finally the output is shown in the screen.
Experiment No: 15
Date:
.11
.11
Experiment No: 16
Date:
.11
7. Go to feature tool and select extrude / revolve feature depend the final shape of the 3D object. Use revolve option for cone and other symmetry object. 8. Go to Menu Tools Mass Properties and find the Volume and Surface area of the 3D object as shown below
Experiment No: 16
Date:
.11
9. Manually Check the Volume and Surface area of the 3D object and compare the same with the solid works mass properties. 10.Consider radius of the cylinder is 25mm and height is 10mm. The volume of cylinder = r2 h = 3.14 x 252 x 100 = 196349.54 mm3. The surface area of cylinder = 2 r (r + h) = 2 x 3.14 x 25 (25 + 100) = 19634.95 mm2. Result:
The volume and surface area of the given 3D object is calculated from mass properties command in solid works and manually. Both the results are found same.