Write a program that prompts a user to enter the average speed of a vehicle traveling...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that prompts a user to enter the average speed of a vehicle traveling and the time which it traveled. The speed should be given in miles-per-hour (MPH) and the time should be in hours. Once entered, the program should calculate the distance traveled at EACH hour of the vehicle's journey. The output should look something like this: What is the speed of the vehicle? (MPH): 40 How many hours has is traveled for?: 3 Hour Distance 1 2 3 40 80 120 You can use the following formula to calculate the dista traveled at each hour: Distance Traveled = Speed * Time Write a program that prompts a user to enter the average speed of a vehicle traveling and the time which it traveled. The speed should be given in miles-per-hour (MPH) and the time should be in hours. Once entered, the program should calculate the distance traveled at EACH hour of the vehicle's journey. The output should look something like this: What is the speed of the vehicle? (MPH): 40 How many hours has is traveled for?: 3 Hour Distance 1 2 3 40 80 120 You can use the following formula to calculate the dista traveled at each hour: Distance Traveled = Speed * Time
Expert Answer:
Answer rating: 100% (QA)
5 MA JS 8 mainpy def calculatedistancespeed time return s... 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
-
Additional data obtained from an examination of the accounts in the ledger for 20Y3 are as follows a The investments were sold for $210,000 cash b. Equipment and land were acquired for cash c. There...
-
1. Insert a module and create a subroutine named Receipt(). Excel 2. Place a button with the name "Generate Receipt" that would link to this subroutine when clicked. Do the following parts from 3 to...
-
Luthan Company uses a plantwide predetermined overhead rate of $23.90 per direct labor-hour. This predetermined rate was based on a cost formula that estimated $286,800 of total manufacturing...
-
The AND function can be realized by using only n number of NOR gates. The value of nequal to
-
1. Why was Cincinnati Zoo losing opportunities to increase revenue? 2. Why was replacing legacy point-of-sale systems and implementing a data warehouse essential to an information system solution? 3....
-
What are the major functions or activities performed by accountants in private industry?
-
Which interest rate on a bond determines the amount of the semiannual interest payment? a. Market rate b. Effective rate c. Stated rate d. None of the above
-
Roger Kramers wife Sarah passed away five years ago, and she made Roger promise to continue to provide care for Sarahs sister Margaret Smith and let her live in their residence for a period of time....
-
As a result, these companies typically do not engage in major expansions and rarely have exponential growth opportunities. Founded 1994 Core Business Gas AltaGas Company Profile Natural gas gathering...
-
Mariah Enterprises makes a variety of consumer electronic products. Its camera manufacturing plant is considering choosing between two different processes, named Alpha and Beta, which can be used to...
-
Burmer Co. has accumulated data to use in preparing its annual profit plan for the upcoming year. The cost behavior pattern of the maintenance costs must be determined. Data regarding the machine...
-
A boy is pulling his sister in a wagon, as shown in the figure. He exerts a force of F = 42.5 N at an angle of 30. How much work does the boy do pulling his sister, in joules, if he pulls her 29 m? F...
-
2. (15 pts) Two fair coins are flipped and player I is allowed to view the outcome, player II is not. Player I can fold and pay player II $2, or stay. If player I stays, then player II must try to...
-
Question 1 of 2 View Policies Current Attempt in Progress Hale Company Janish Company Valdez Company (a) Oriole Company has a balance in its Accounts Payable control account of $8,170 on January 1,...
-
A car leaves point A and drives at 100.0 km/h [E] for 1.2 h. It then heads north at 75.0 km/h for 0.6 h and finally [N42.0W] at 95.0 km/h for 1.0 h, arriving at point B. (a) Determine the distance...
-
3. Kustom Kar Parts expects to incur $480,000 in overhead costs in its three main production departments this year: setup costs ($30,000), machining costs ($330,000), and packing costs ($120,000) to...
-
6. How much cheaper is your mortgage if you pay it off bi-weekly instead of monthly? (You will need to click on "Create a personalized report" and the amortization table will show you your total...
-
A manufacturer can sell product 1 at a profit of $20 per unit and product 2 at a profit of $40 per unit. Three units of raw material are needed to manufacture one unit of product 1, and six units of...
-
A palindrome is any word, phrase, or sentence that reads the same forward and backward. Here are some well-known palindromes: Able was I, Ere I saw Elba A man, a plan, a canal, Panama Desserts, I...
-
Write a program that asks the user for a positive integer no greater than 15. The program should then display a square on the screen using the character X. The number entered by the user will be the...
-
What action is possible with a static method that isnt possible with an instance method?
-
For each of the following procedures, indicate whether sampling would or would not be used. Give reasons for your answers. a. Examinations of marketable securities. b. Confirmation letters sent to...
-
What are control risk assessment procedures?
-
Which of the following statements concerning working papers is incorrect? a. An auditor may support an opinion by other means in addition to working papers. b. The form of working papers should be...
Study smarter with the SolutionInn App