#4d. Codding in python {LAWS OF MOTION}
#Laws of Motion.
print ("If variables are initial velocity,Final velocity,Duration of time & Acceleration in one equation press 1")
print ("If variables are Distance,Initial velocity,Duration of time & Acceleration in one equation press 2")
z=int(input("Enter choice:"))
if (z==1):
print("Find 'Acceleration' press 1"
"Find 'Duration of time' press 2."
"Find 'Initial velocity' press 3."
"Find 'Final velocity' press 4.")
y=int(input("Enter choice:"))
if(y==1):
u=int(input("Enter initial velocity: "))
v=int(input("Enter final velocity: "))
t=int(input("Enter duration of time: "))
a=(v-u)/t
print("Acceleration produced is %d"%(a))
if(y==2):
u=int(input("Enter initial velocity: "))
v=int(input("Enter final velocity: "))
a=int(input("Enter acceleration :"))
t=(v-u)/a
print("Duration of time is %d"%(t))
if(y==3):
v=int(input("Enter final velocity: "))
t=int(input("Enter duration of time: "))
a=int(input("Enter acceleration : "))
u=v-(a*t)
print("Initial velocity was %d"%(u))
if(y==4):
u=int(input("Enter initial velocity: "))
a=int(input("Enter acceleration: "))
t=int(input("Enter duration of time: "))
v=u+(a*t)
print("Final velocity is %d"%(v))
print("Answers given may be rounded off")
if(z==2):
print("Find 'Acceleration' press 1"
"Find 'Duration of time' press 2"
"Find 'Distance' press 3."
"Find 'Initial velocity' press 4")
y=int(input("Enter choice:"))
if(y==1):
u=int(input("Enter initial velocity: "))
s=int(input("Enter distance: "))
t=int(input("Enter duration of time: "))
a=((2*s)-(2*u*t))/(t**2)
print("Acceleration produced is %d"%(a))
if(y==2):
u=int(input("Enter initial velocity: "))
v=int(input("Enter final velocity"))
s=int(input("Enter distance: "))
a=int(input("Enter acceleration :"))
t=(2*s)/(v+u)
print("Duration of time is %d"%(t))
if(y==3):
u=int(input("Enter initial velocity: "))
t=int(input("Enter duration of time: "))
a=int(input("Enter acceleration : "))
s=(u*t)+((a*(t**2))/2)
print("Distance is %d"%(s))
if(y==4):
s=int(input("Enter distance: "))
a=int(input("Enter acceleration : "))
t=int(input("Enter duration of time: "))
u=(2*s-(a*(t**2)))/(2*t)
print("Initial velocity is %d"%(u))
print("Answers given may be rounded off")
Download CODES here.
CLICK HERE for online Python.
print ("If variables are initial velocity,Final velocity,Duration of time & Acceleration in one equation press 1")
print ("If variables are Distance,Initial velocity,Duration of time & Acceleration in one equation press 2")
z=int(input("Enter choice:"))
if (z==1):
print("Find 'Acceleration' press 1"
"Find 'Duration of time' press 2."
"Find 'Initial velocity' press 3."
"Find 'Final velocity' press 4.")
y=int(input("Enter choice:"))
if(y==1):
u=int(input("Enter initial velocity: "))
v=int(input("Enter final velocity: "))
t=int(input("Enter duration of time: "))
a=(v-u)/t
print("Acceleration produced is %d"%(a))
if(y==2):
u=int(input("Enter initial velocity: "))
v=int(input("Enter final velocity: "))
a=int(input("Enter acceleration :"))
t=(v-u)/a
print("Duration of time is %d"%(t))
if(y==3):
v=int(input("Enter final velocity: "))
t=int(input("Enter duration of time: "))
a=int(input("Enter acceleration : "))
u=v-(a*t)
print("Initial velocity was %d"%(u))
if(y==4):
u=int(input("Enter initial velocity: "))
a=int(input("Enter acceleration: "))
t=int(input("Enter duration of time: "))
v=u+(a*t)
print("Final velocity is %d"%(v))
print("Answers given may be rounded off")
if(z==2):
print("Find 'Acceleration' press 1"
"Find 'Duration of time' press 2"
"Find 'Distance' press 3."
"Find 'Initial velocity' press 4")
y=int(input("Enter choice:"))
if(y==1):
u=int(input("Enter initial velocity: "))
s=int(input("Enter distance: "))
t=int(input("Enter duration of time: "))
a=((2*s)-(2*u*t))/(t**2)
print("Acceleration produced is %d"%(a))
if(y==2):
u=int(input("Enter initial velocity: "))
v=int(input("Enter final velocity"))
s=int(input("Enter distance: "))
a=int(input("Enter acceleration :"))
t=(2*s)/(v+u)
print("Duration of time is %d"%(t))
if(y==3):
u=int(input("Enter initial velocity: "))
t=int(input("Enter duration of time: "))
a=int(input("Enter acceleration : "))
s=(u*t)+((a*(t**2))/2)
print("Distance is %d"%(s))
if(y==4):
s=int(input("Enter distance: "))
a=int(input("Enter acceleration : "))
t=int(input("Enter duration of time: "))
u=(2*s-(a*(t**2)))/(2*t)
print("Initial velocity is %d"%(u))
print("Answers given may be rounded off")
Download CODES here.
CLICK HERE for online Python.
Comments