HW  4


Jet
#include <stdio.h>
#include <math.h>
int main(void)
{
double itime, velocity, acceleration;
printf("Enter new time value in seconds: \n");
scanf("%lf",&itime);
velocity = 0.00001*pow(itime,3) - 0.00488*pow(itime,2) + 0.75795*itime
+ 181.3566;
acceleration = 3 - 0.000062*velocity*velocity;
printf("Velocity = %8.3f m/s \n",velocity);
printf("Acceleration = %8.3f m/sˆ2 \n",acceleration);
return 0;
}

1/ value time =57 and 58s
2/ value time = 24-> 31
3/
#include <stdio.h>
#include <math.h>
int main(void)
{
double itime, velocity, acceleration, time_m;
printf("Enter new time value in min: \n");
scanf("%lf",&time_m);
itime = time_m*60;
velocity = 0.00001*pow(itime,3) - 0.00488*pow(itime,2) + 0.75795*itime
+ 181.3566;
acceleration = 3 - 0.000062*velocity*velocity;
printf("Velocity = %8.3f m/s \n",velocity);
printf("Acceleration = %8.3f m/sˆ2 \n",acceleration);
return 0;
}
4/a
#include <stdio.h>
#include <math.h>
int main(void)
{
double itime, velocity, acceleration,velocity_ft;
printf("Enter new time value in seconds: \n");
scanf("%lf",&itime);
velocity = (0.00001*pow(itime,3) - 0.00488*pow(itime,2) + 0.75795*itime+ 181.3566);
velocity_ft = velocity*3.28;
acceleration =( 3 - 0.000062*velocity*velocity)*3.28;
printf("Velocity_ft = %8.3f ft/s \n",velocity_ft);
printf("Acceleration = %8.3f ft/sˆ2 \n",acceleration);
return 0;}


4/b
#include <stdio.h>
#include <math.h>
int main(void)
{
double itime, velocity, acceleration,velocity_ft;
printf("Enter new time value in seconds: \n");
scanf("%lf",&itime);
velocity = (0.00001*pow(itime,3) - 0.00488*pow(itime,2) + 0.75795*itime+ 181.3566);
velocity_ft = (velocity*3.28)*60;
acceleration =( 3 - 0.000062*velocity*velocity)*3.28*0.000277;
printf("Velocity_ft = %8.3f ft/min \n",velocity_ft);
printf("Acceleration = %8.6f ft/minˆ2 \n",acceleration);
return 0;}


5/
#include <stdio.h>
#include <math.h>
#define e 2.178
int main(void)
{
double b, x, y;
printf("enter value b and x : \n");
scanf("%lf %lf",&b,&x);
if (b>0&b!=1)
{y=logb(x);
printf("y= %5.2f \n",y);}
else
printf("MATH ERROR !(@.@) \n");
return 0;}

Comments

Popular posts from this blog