John Robert F. Alejano
Joseph Emmanuel B. Golez
Piolo L. Pigao
Gabriel Sebastian V. Gosiaoco
Krystopher Kyle A. Navarro
Arlo Octavio G. Sta. Ana
Justine Lloyd S. Dalimo-os
#include <stdio.h>
int main(){
char z[200];
float radius = 0;
int cs = 0;
float starter = 0;
float D,L,W = 0 ;
float percircle,rpmt,ans;
int c = 4;
int rpm,back,add;
int pi = 3.14;
float w = 0;
float r = 0;
float v = 0;
float rpms = 0;
float pis = 3.14159265358979323846264338327950288419716939937510;
int i = 2;
float aa = 0;
float bb = 0;
float QQ = 0;
do {
printf("what is your name? : ");
scanf("%[^\n]",z);/*ma type sang name */
printf("\n\n");
printf("\n\n");
printf("\t\t --------------------welcome! %s--------------------\n\n", z );/*first name lang ma register sa string */
printf("\n\n");
printf("\t\t-------------------- Industrial Programs--------------------");
printf("\n\n");
printf("\t\t\n Industrial problems");
printf("\n");
printf("\t 1 ::: Perimeter of circle");
printf("\t\t\t 5 ::: Volume timerate");
printf("\n");
printf("\t 2 ::: Perimeter of square");
printf("\n");
printf("\t 3 ::: Speed of mechanism");
printf("\n");
printf("\t 4 ::: RPM of HSS drill");
printf("\n");
printf("\n\n");
printf("pick a number:");
scanf("%f",&starter); /* give a value for the if staterment to proceed */
if (starter == 1 ) {
printf("----------------------------------------\n\n\n");
printf("\tPerimeter or Circumference of Circle");
printf("\n\n");
printf("radius of circle :");
scanf("%f",&radius);
printf("\n\n");
percircle = ( pi * 2 * radius);
printf (" Circumference = 2(3.14)(radius = %f)",radius);
printf("\n\n");
printf("The Circumference of the circle is : %.2f", percircle);
printf("\n\n");
printf("1 ::: quit: ");
printf("0 ::: return :::");
scanf("%d",&back);
printf("okay bye", back ); /*para mag end sang program */
}else if ( starter == 2 ){
printf("------------------------------------------------------------\n\n\n");
printf("perimeter of square");
printf("\n\n");
printf("Length : ");
scanf("%f",&L);
printf("Width : ");
scanf("%f",&W);
ans = (L * 2) + (W * 2);
printf("\n\n");
printf("Perimeter of square = (Length = %f * 2)+ (Width = %f * 2)",L,W);
printf("\n\n");
printf("P = %.2f",ans);
printf("\n\n");
printf("1 ::: quit: ");
printf("0 ::: return :::");
scanf("%d",&back);
printf("bye", back );
}
else if (starter == 3){
printf("\n\n");
printf("Calculate speed of mechanism\t");
printf("please enter the rpm of your mechanism:\t" );
scanf("%f",&rpms);
printf("\n\n");
printf("please enter the radius:\t");
scanf("%f",&r);
w=i*pis*rpms;
v=w*r;
printf("\n\n");
printf("angular speed is %.2f\t",w);
printf("\n\n");
printf("linear speed of the crank is: %.2f",v);
printf("\n\n");
printf("1 ::: quit: ");
printf("0 ::: return :::");
scanf("%d",&back);
printf("bye", back );
}
else if (starter == 4){
printf("------------------------------------------------------------\n\n\n");
printf("Calculate the RPM with HSS drills");
printf("\n\n");
printf("cutting speed :");
scanf("%d",&cs);
printf("Diameter :");
scanf("%f", &D);
printf("\n\n");
rpm = ( cs * c ) /D;
rpmt = ( cs * c ) /D;
printf("Rpm = (%d x 4) / (%f)",cs,D);
printf("\n\n");
printf("The Rpm is : %d ",rpm);
printf("\n\n");
printf("True value with 2 decimal places : %.2f",rpmt);
printf("\n\n");
printf("1 ::: quit: ");
printf("0 ::: return :::");
scanf("%d",&back);
printf(" bye", back );
}
else if (starter == 5){
printf("time rate calculator");
printf("\n\n");
printf("container volume: ");
scanf("%f",&aa);
printf("\n\n");
printf("flow rate:");
scanf("%f",&bb);
QQ = aa/bb;
printf("filled a tank with %.2fm^3 volume with a flow rate of %fm^3/min in a total time rate of %.2f min",aa,bb,QQ);
printf("\n\n");
printf("0 ::: return :::");
printf("1 ::: quit: ");
scanf("%d",&back);
printf(" bye", back ); }
}while (back < 1);
return 0;
}