1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
koban [17]
3 years ago
5

Write a program that asks the user for the speed of a vehicle (in miles per hour) and how many hours it has traveled. It should

then use a loop to display the total distance traveled at the end of each hour of that time period
Computers and Technology
1 answer:
HACTEHA [7]3 years ago
5 0

Answer:

speed = float(input("Enter the speed: "))

hours = int(input("Enter the hours: "))

distance = 0

for i in range(hours):

   distance += speed * 1

   print("The distance after " + str(i+1) + ". hour(s): " + str(distance))

Explanation:

*The code is in Python.

Ask the user to enter the speed and the hours

Initialize the distance as 0

Create a for loop that iterates hours times. Inside the loop, calculate the cumulative distance traveled at the end of each hour and print it (Note that the distance = speed x hour)

You might be interested in
Your worksheet has the value 27 in cell B3. What value is<br>returned by the function =MOD(B3,6)?​
Digiron [165]

Answer:

3

Explanation:

MOD means the remainder after a division calculation.

\frac{27}{6}= 4r3

The remainder is 3

5 0
3 years ago
using a timer to generate a random number, develop a program that displays random numbers between 1 and 47 (or whatever) for you
mestny [16]

Answer:

Explanation:

The following code is written in Python. It creates a variable that detects the current time. Then it loops through a range of numbers and chooses the last random number after 2 seconds. Finally, it prints that number to the screen. This function can be called countless times depending on the number of state lottery numbers needed.

import random

import time

start_time = time.time()

while time.time() - start_time < 2:

   lottery_number = random.randint(0, 48)

print(lottery_number)

3 0
3 years ago
The following program is run. Then the user clicks the "bottomButton" TWO TIMES. What will be displayed in the console?
IrinaK [193]

Answer:

A. aaa

bbb

ccc

ccc

ddd

B. bbb

ddd

ccc

ccc

C. bbb

ddd

aaa

aaa

D. bbb

ccc

ccc

ddd

8 0
3 years ago
Read 2 more answers
What is the full form of EPROM (CLASS-6)
vodomira [7]

Answer:

earth planet rest orbit moon

4 0
2 years ago
Read 2 more answers
a. Show the output of the following program: 1: public class Test { 2: public static void main ( String [] args ) { 3: A a = new
faust18 [17]

Answer:

See attached file.

Explanation:

See attached file.

Download txt
3 0
3 years ago
Other questions:
  • According to the family life course development framework, the __________ stage of the family life cycle comes to an end with th
    7·1 answer
  • Information systems security is the collection of activities that protect the information system and the data stored in it.
    12·1 answer
  • List two reasons why “buying a computer is no easy task” ?
    12·2 answers
  • A server would experience a __________ attack when a hacker compromises it to acquire information from it from a remote location
    13·1 answer
  • Identify the layout in which you will be able to view and edit the header and footer
    12·1 answer
  • If you have two redo log groups with four members each, what’s the optimal number of disks you need to provide appropriate prote
    5·1 answer
  • He flow of electric charges through a material describes an electric _______.
    10·1 answer
  • Can someone please help me I need to turn this in my 3:00pm Eastern time
    12·1 answer
  • Ok so I’m using a word document and towards the bottom of the page it stops me from moving my text box any further down even tho
    13·2 answers
  • The ____ file is typically saved with a prefix of inc_.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!