Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

Understand how customers respond to effective service recovery.

Answered: 1 week ago