Question: one example Description : Assuming there are no accidents or delays, the distance that a car travels down the interstate can be calculated with the

one example

Description: Assuming there are no accidents or delays, the distance that a car travels down the interstate can be calculated with the following formula:

Distance = Speed x Time

Prompt the user for the speed the car is traveling and calculate the distance traveled for 5, 8 and 12 hours. The output should be in the form of

The distance the car will travel in 5 hours is xxx

The xxx is the calculated miles traveled.

Initial Algorithm:

Declare variables

Get the speed

Calculate distance for 5 hours

Calculate distance for 8 hours

Data Requirements:(I/O)

Input speed

Output distance5

Output distance 8

Formulas: Distance = Speed x Time

Refined Algorithm

Declare Constant int TIME_5 = 5

Declare Constant int TIME_8 = 8

Refined Algorithm

Declare Constant int TIME_5 = 5

Declare Constant int TIME_8 = 8

Declare Constant int TIME_12 = 12

Declare float speed

Declare float distance5

Declare float distance8

Declare float distance12

Display Please enter the speed

Input speed

one example Description: Assuming there are no accidents or delays, the distance

Write a program that computes and displays the discount price of an item. The user will enter the price of the item and the amount of the discount as a percent Initial Algorithm: Data Requirements Formulas: Refined Algorithm

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!