Uploaded by ehsan.shah90

lab file

advertisement
Q:Drive 1st equation of motion.
#include <iostream>
using namespace std;
int main (){
int final_velocity;
int initial_velocity ;
int time;
int acceleration;
char m= 'm';
char b= '/';
char s= 's';
// we are going to find final velocity by using first equation of
motion vf=vi+at
initial_velocity= 43;
time= 41;
acceleration= 10;
final_velocity= initial_velocity+acceleration*time;
cout <<"final velocity is"<<" "<<final_velocity<<m<<b<<s;
return 0;
}
Q:Drive 2nd equation of motion.
#include <iostream>
using namespace std;
int main (){
int distance;
int initial_velocity ;
int time;
int acceleration;
char m= 'm';
char b= '/';
char s= 's';
// we are going to find distanced by using second equation of motion
s=vi*t+0.5*a*t*t
initial_velocity= 40;
time= 40;
acceleration= 20;
distance= (initial_velocity *time)+(0.5*acceleration*time*time);
cout <<"distance is"<<" "<<distance<<m<<b<<s;
return 0;
}
Q:Drive 3rd equation of motion.
#include <iostream>
using namespace std;
int main(){
int final_velocity;
int initial_velocity;
int acceleration;
int distance;
char m='m';
char b='/';
char s='s';
// we are going to find distance using 3rd equation of motion
2as=vf*vf-vt-vt
final_velocity= 10;
acceleration= 25;
initial_velocity= 12;
distance=(final_velocity*final_velocityinitial_velocity*initial_velocity)/2*acceleration;
cout<<"initial_velocity is"<<" "<<initial_velocity<<m<<b<<s;
return 0;
}
Q:Drive newton 2nd law.
#include <iostream>
using namespace std;
int main(){
int force;
int mass;
int acceleration;
char N = 'N';
// we are using newton 2nd law formula f=ma for fing net force
mass= 20;
acceleration= 3;
force= mass*acceleration;
cout<<"force is"<<" "<<force<<N;
return 0;
}
Download