You are on page 1of 1

Acceleration

Suppose you know how long it takes a car to accelerate from 0 to 60 miles per hour. Develop
an algorithm for computing the time required to travel a given distance (for example 5 miles),
assuming that the car is initially at rest, accelerates to a given speed (for example 25 miles per
hour), and drives at that speed until the distance is covered.

Hint: An object that starts at rest and accelerates at a constant rate a for t seconds travels a
distance of s at2.

Input(s) Processing Output(s)

Pseudocode

BEGIN
INPUT

PROCESS

OUTPUT

END

C++ Code

int main()
{
// declare variables

// input

// process

// output

You might also like