Friday, December 13, 2019

Scientific Problems in C

A menu-driven program that will solve various scientific conversion using the C programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/
https://www.unlimitedbooksph.com/

If you like my video tutorials kindly click the like button and subscribe for more video tutorials on my channel.


Thank you very much for your help and support.


Program Listing

scientific.c

#include <stdio.h>
#include <stdlib.h>


int main(){

int menu;
float n1,n2,ans;
float G=9.8;

while(menu !=6){
printf("\n\n");
printf("\t*********SCIENTIFIC PROBLEMS*********");
printf("\n");
        printf("\n\t-----Press 1 to solve for Force--------\n");
printf("\n\t-----Press 2 to solve for Mass---------\n");
printf("\n\t-----Press 3 to solve for Momentum-----\n");
printf("\n\t-----Press 4 to solve for Power--------\n");
printf("\n\t-----Press 5 to solve for Work---------\n");
printf("\n\t-----Press 6 to Exit-------------------\n");
  printf("\n\nEnter your choice:\n");
  scanf("%d",&menu);
  system ("cls");
  
  if(menu == 1){  
printf("\t Solving for Force using Mass and acceleration.\n");
     printf("\n\nGive the value of Mass in kilograms:");
     scanf("%f",&n1);
     printf("\n\n");
     printf("Give the acceleration in meters/second:");
     scanf("%f",&n2);
     printf("\n\n");
     ans = (n1*n2);
     printf("The Force is %.2f Newtons.",ans);  
  else if(menu == 2){  
     printf("\t Solving for Force using Mass and acceleration.\n");
     printf("\n\nGive the value of Mass in kilograms:");
     scanf("%f",&n1);
     printf("\n\n");
     printf("Give the acceleration in meters/second:");
     scanf("%f",&n2);
     printf("\n\n");
     ans = (n1*n2);
     printf("The Force is %.2f Newtons.",ans);
}
  else if(menu == 3){  
printf("\t Solving for Momentum using Mass and Velocity.\n");
     printf("\n\nGive the value of Mass in kilograms:");
     scanf("%f",&n1);
     printf("\n\n");
     printf("Give the value of Velocity in meters/second:");
     scanf("%f",&n2);
     printf("\n\n");
       ans = (n1*n2);
     printf("The Momentum is %.2f kg m/s.",ans);
}
  else if(menu == 4){
printf("\t Solving for Power using Work and Time.\n");
     printf("\n\nGive the value of Work:");
     scanf("%f",&n1);
     printf("\n\n");
     printf("Give the Time in seconds:");
     scanf("%f",&n2);
     printf("\n\n");
     ans = (n1/n2);
     printf("The Power is %.2f Watts.",ans);
}
      else if(menu == 5){
     
    printf("\t Solving for Work using Force and Distance.\n");
     printf("\n\nGive the value of Force:");
     scanf("%f",&n1);
     printf("\n\n");
     printf("Give the Distance:");
     scanf("%f",&n2);
     printf("\n\n");
     ans = (n1*n2);
     printf("The Work is %.2f Joules.",ans);
}
  else if(menu==6){     
     printf("\t\tExiting program\n");
     return 0;
  }
}
return 0;
}


No comments:

Post a Comment