The distance a vehicle travels can be calculated as follows: distance = speed * time For...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The distance a vehicle travels can be calculated as follows: distance = speed * time For example, if a train travels 40 miles per hour for three hours, the distance traveled is 120 miles. Write a program that askes the user to enter the speed of a vehicle and the number of hours it has traveled. It should then use a loop to display the distance the vehicle has traveled for each hour of that time period. It then shows the accumulated distance at the end. Here is an example of the desired output: Enter the speed of the vehicle in mph: 45 Enter the number of hours traveled: 6 Hour Distance Traveled 1 2 3 4 5 56 45.0 90.0 135.0 180.0 225.0 270.0 6 The accumalated distance travaled is: 945.0 mp 5. The distance a vehicle travels can be calculated as follows: distance = speed * time For example, if a train travels 40 miles per hour for three hours, the distance traveled is 120 miles. Write a program that askes the user to enter the speed of a vehicle and the number of hours it has traveled. It should then use a loop to display the distance the vehicle has traveled for each hour of that time period. It then shows the accumulated distance at the end. Here is an example of the desired output: Enter the speed of the vehicle in mph: 45 Enter the number of hours traveled: 6 Hour Distance Traveled 1 2 3 4 5 56 45.0 90.0 135.0 180.0 225.0 270.0 6 The accumalated distance travaled is: 945.0 mp 5.
Expert Answer:
Answer rating: 100% (QA)
Heres a Python program that does what described in question Get the speed of the vehicle from the user speed floatinputEnter the speed of the vehicle in mph Get the number of hours traveled from the u... View the full answer
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Posted Date:
Students also viewed these programming questions
-
Due to erratic sales of its sole producta high-capacity battery for laptop computersPEM, Incorporated, has been experiencing financial difficulty for some time. The company's contribution format...
-
The distance a vehicle travels can be calculated as follows: Distance = Speed * Time For example, if a train travels 40 miles-per-hour for three hours, the distance traveled is 120 miles. Write a...
-
Two-dimensional array operations: Movie Ratings program ** You have recently collected reviews from four movie reviewers where the reviewers are numbered 1-4. Each reviewer has rated six movies where...
-
Which one the below does not define "Work role boundaries" of a care worker limits that allow a patient and staff to connect safely in a therapeutic relationship based on patients' needs rules of...
-
A 60.0-kg person is standing at rest on level ground. How fast would she have to run to (a) Double her total energy and (b) Increase her total energy by a factor of 10?
-
Write pseudocode for each example (a through e) in Exercise 2, making sure your pseudocode is structured and accomplishes the same tasks as the flowchart segment. Data From Exercise 2 a. b. D Yes NO...
-
Von Krmn assumed a cubic profile for the integral momentum analysis over a flat plate. Since a cubic has four constants, four conditions were used. (i) \(V_{x}=0\) at \(y=0\). (ii)...
-
Mr. LN. Vestor is retired and slowly selling some of his assets to supplement his retirement income. He wants to have some idea of how much tax he is going to owe for 2020 on the asset sales that...
-
Compute the standard deviation for your two asset portfolio Asset X: Weight = 0.5 Standard deviation = 0.0595 Correlation = 0.3568 Asset Y: Weight = 0.5 Standard deviation = 0.0930 Correlation =...
-
Kennedy Prisby, age 33, is single and has no dependents. Her social security number is 111-22-3333. Her address is 101 North Fork Ave., Cedar City, UT 84720. She has no intention of donating to the...
-
2. A new bridge across the Cumberland River is being planned near a busy high-way intersection in the commercial part of a midwestern town. The construction (first) cost of the bridge is $1,900,000...
-
Essential Super Market Corporation holds a 70% stake in Sandalwood Products Corporation's common stock. On January 1, 20X1, Essential purchased land for $500,000 from an independent third party. On...
-
2. 3. 4. Discuss the primary advantages of GUI over a textual (command-line) interface in Linux system administration. Describe two (2) linux desktop environments and explain how they generally...
-
Why are pigment molecules often found embedded in membranes ?
-
Suppose that production of 1 unit of mining requires 3 / 7 unit of mining, 2 / 7 unit of manufacturing, 2 / 7 unit of communication. To produce 1 unit of manufacturing requires 5 / 7 unit of mining,...
-
2 . The Outpour Company has three matters that may need to be disclosed or reported as of the end of their fiscal year: a . Outpour has been sued for damages by a customer who was injured while using...
-
You find the following financial information about a company: net working capital = $936; fixed assets = $6,977; total assets = $11,526; and long-term debt = $4,251. What is the company's total...
-
The Pletcher Transportation Company uses a responsibility reporting system to measure the performance of its three investment centers: Planes, Taxis, and Limos. Segment performance is measured using...
-
True or False: When a method is declared with the final modifier, it must be overridden in a subclass.
-
Look at the following SQL statement. SELECT Id FROM Account What is the name of the table from which this statement is retrieving data? What is the name of the column that is being retrieved?
-
Whats wrong with the following array declarations? Int[] readings = new int[-1]; Double[] measurements = new double[4.5];
-
A response to the IASB's Exposure Draft 2009/5 Fair Value Measurements, stated: In practical terms we doubt that an asset measured on any other basis than its intended use will provide more useful...
-
Palm Ltd acquired a business that used a large number of assets that worked in combination to produce a product saleable in offshore markets. The assets of the business include a computer program...
-
In a business combination, Skyentist Ltd acquired inventory that is sold in three different markets: Market A, Market \(B\) and Market C. Some information gathered in relation to these three markets...
Study smarter with the SolutionInn App