Assume a route between two points has several segments (legs). Each segment has a distance and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Assume a route between two points has several segments (legs). Each segment has a distance and estimated speed. Write a program to determine the total time for the route. For this program, prompt the user for the number of segments, and then use a for or while statement to loop over each segment, prompting the user for the distance and estimated speed for each segment, and totaling the total time. Here is an example run (user input in blue): Number of legs: 2 Leg 1: Enter leg distance (miles) 20 Enter leg speed (miles/hour): 30 Leg 2: Enter leg distance (miles): 40 Enter leg speed (miles/hour) 50 Total time (minutes): 88 Assume a route between two points has several segments (legs). Each segment has a distance and estimated speed. Write a program to determine the total time for the route. For this program, prompt the user for the number of segments, and then use a for or while statement to loop over each segment, prompting the user for the distance and estimated speed for each segment, and totaling the total time. Here is an example run (user input in blue): Number of legs: 2 Leg 1: Enter leg distance (miles) 20 Enter leg speed (miles/hour): 30 Leg 2: Enter leg distance (miles): 40 Enter leg speed (miles/hour) 50 Total time (minutes): 88
Expert Answer:
Answer rating: 100% (QA)
You can create a Python program to calculate the total time for a route with multiple segments using ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Looking-forward Productions is considering a project with an initial start-up cost of RM960,000. The firm maintains a debt-equity ratio of 0.50 and has a flotation cost of debt of 6.8 percent and a...
-
Straight-Line, Declining-Balance, and Sum-of-the-Years'-Digits Methods A light truck is purchased on January 1 at a cost of $14,000. It is expected to serve for eight years and have a salvage value...
-
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...
-
Assuming @Weather is a valid repeatable annotation that takes a String, with its associated containing type annotation @Forecast, which of the following can be applied to a type declaration? (Choose...
-
Sketch the magnitude characteristic of the bode plot for the transfer function. Discuss.
-
The balance sheets of Pam and Sun Corporations, an 80 percent-owned subsidiary of Pam, at December 31, 2016, are as follows (in thousands): The book value of Pam's bonds reflects a $100,000...
-
Describe the hiring decision of a perfectly discriminating monopsonist and of a nondiscriminating monopsonist. In what sense do monopsonists exploit workers?
-
Is there a significant difference in the level of community service participation between college and high school graduates? According to the 2010 GSS, 38% of 160 college graduates reported...
-
You are 28 years old. You plan to save for your retirement between now and age 65 (when you retire). You would like your savings to finance a retirement income of $65,000 per year (at the end of the...
-
Daniel Company uses a periodic inventory system. Data for 2015: beginning merchandise inventory (December 31, 2014), 2,000 units at $38; purchases, 8,000 units at $40; expenses (excluding income...
-
Hasson Company uses normal costing to cost each job. Its job-costing system has two direct-cost categories (direct materials and direct manufacturing labor) and one indirect-cost pool (manufacturing...
-
Maslow and Herzberg may view the relationship between the extrinsic and intrinsic factors somewhat differently. Which theory best aligns with your approach to creating a motivating climate for staff ?
-
What transpired during the interview, and how do you feel? Are there any areas you need to work on next time if not successful?
-
Find resources on the great man theory, trait theory, and skills theory. Respond to the following questions: Elaborate on which theory best describes Mahatma Gandhi, Martin Luther King, and Nelson...
-
Which OSI layer is responsible for connection - oriented communication?
-
ok nt int ences If a person standing at the first-floor entrance to Sears Tower (recently renamed Willis Tower) in Chicago weighs exactly 140 lb, determine the weight while he or she is standing on...
-
A definite amount of gaseous hydrocarbon was burnt with just sufficient amount of O. The volume of all reactants was 600 ml, after the explosion the volume of the products [CO(g) and HO(g)] was found...
-
Per Bag Direct materials: 25 pounds of CWhiz-2000 @ $0.08/lb. = $ 2.00 Direct labor: 0.05 hour @ $32.00/hr. = $ 1.60 The company manufactured 100,000 bags of Cheese-Be-Good in December and used...
-
The bargaining power of both sides is affected by a number of factors. Identify the factors that affect managements and the unions bargaining power.
-
The workplace in this situation is a casino. The casino employees have been unionized for the past decade. Initially they were represented by a small independent union, but three years ago that union...
-
Explain what you, at this point in the course, see as the benefits and drawbacks of a unionized workplace, both for the workers and for the employer. As in the previous exercise, compare your...
-
Obtain the time variation of the lift and propulsive force coefficients and their plots for the airfoil given by Example 8.5. Assume that the profile pitches about quarter chord point. Example 8.5...
-
Write down a numerical solution algorithm for the LU decomposition solution of the pseudo penta diagonal matrix equation given by (A11.4). A11.4 || B C 2 A2 B2 C2 922 An-1 Bn-1 Cn-1 -1 An Bn R R Rn-1...
-
Obtain Eq. 8.66 as a relation between the wake vorticity and the reduced circulation. Eq. 8.66 w(x) = k(Q; cosx-22, sin x) cos ks +k(Q; sin x+Q, cos x) sinks, Q = Q, +Q;i
Study smarter with the SolutionInn App