Challenge 44
🚗
SUVAT - Equations of Motion
To calculate an object's motion (ignoring external forces like friction/air resistance), we can use the SUVAT equations as shown in the image here
Note how with 3 known values, you are able to solve the other 2
Create a program that gets the user to input 3 of the values and calculates the other 2. How you do this is up to you - you could allow the user choose the variables they want to enter/equation they want to use from a menu, or you could allow them to enter a string like u=0,v=100,t=20 and parse it yourself (which would be useful if e.g. having a huge file of similar strings which your program could iterate through and solve)
You can use a site like this to check your answers:
Examples:
Inputs of u=0, v=100, t=20 would output s = 1000m, a = 5m/s
Inputs of s=500, u=-50, v=100 would output a = 7.5m/s**2, t = 20s
Extension:
Rather than having multiple different input prompts, allow the user to enter all their values at once in a form like u=0,v=100,t=20