Acceleration is the rate at which an object changes its velocity. It is typically represented by symbol a and measured in m/s2 (meters per second squared). Write the algorithm (steps in pseudocode) and the corresponding program to calculate the acceleration of a vehicle given the speed in miles per hour and the time in seconds. Use the formula provided below to calculate the acceleration in meters per second squared. The program must prompt the user to enter a velocity in miles per hour and a time in seconds as double precision real numbers and then display the resulting acceleration as a double precision real number. The acceleration must be rounded off to one decimal digit but displayed with two decimal digits.

Respuesta :

Answer:

Pseudocode:

INPUT velocity

INPUT time

SET velocity = 0.44704 * velocity

SET acceleration = velocity / time

SET acceleration = round(acceleration, 1)

PRINT acceleration

Code:

velocity = float(input("Enter a velocity in miles per hour: "))

time = float(input("Enter a time in seconds: "))

velocity = 0.44704 * velocity

acceleration = velocity / time

acceleration = round(acceleration, 1)

print("The acceleration is {:.2f}".format(acceleration))

Explanation:

*The code is in Python.

Ask the user to enter the velocity and time

Convert the miles per hour to meters per second

Calculate the acceleration using the formula

Round the acceleration to one decimal using round() method

Print the acceleration with two decimal digits

ACCESS MORE
EDU ACCESS
Universidad de Mexico