Driving is expensive. Write a program with a car's gas milage (miles/gallon) and the cost of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Driving is expensive. Write a program with a car's gas milage (miles/gallon) and the cost of gas (dollars/gallon) as floating-point input, and output the gas cost for 20 miles, 75 miles, and 500 miles. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print (f' {your_value1:.2f} {your_value2:.2f} {your_value3:.2f}') Ex: If the input is: 20.0 3.1599 where the gas mileage is 20.0 miles/gallon and the cost of gas is $3.1599/gallon, the output is: 3.16 11.85 79.00 Note: Real per-mile cost would also include maintenance and depreciation. 436254.3150360.qx3zqy7 LAB ACTIVITY 1 2 2.18.1: LAB: Driving costs Type your code here. *** main.py 0/10 Load default template... Driving is expensive. Write a program with a car's gas milage (miles/gallon) and the cost of gas (dollars/gallon) as floating-point input, and output the gas cost for 20 miles, 75 miles, and 500 miles. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print (f' {your_value1:.2f} {your_value2:.2f} {your_value3:.2f}') Ex: If the input is: 20.0 3.1599 where the gas mileage is 20.0 miles/gallon and the cost of gas is $3.1599/gallon, the output is: 3.16 11.85 79.00 Note: Real per-mile cost would also include maintenance and depreciation. 436254.3150360.qx3zqy7 LAB ACTIVITY 1 2 2.18.1: LAB: Driving costs Type your code here. *** main.py 0/10 Load default template...
Expert Answer:
Answer rating: 100% (QA)
e mainpy Get mileage and gas cost inputs 2 mileage floatinput gascost floatinput ANNAFELBOGE 3 ... View the full answer
Related Book For
An Introduction to Management Science Quantitative Approaches to Decision Making
ISBN: 978-1111823610
14th edition
Authors: David R. Anderson, Dennis J. Sweeney, Thomas A. Williams, Jeffrey D. Camm, James J. Cochran
Posted Date:
Students also viewed these programming questions
-
a. Use any word to explain denotative and connotative meaning of that word. b. Share three examples of words that can be categorized as ambiguous language . c. Share three examples of words that can...
-
After graduating from college, Melissa Malone landed a position with Orchard Creek, one of the finest children's boutiques in the Boston area. Three years ago, Melissa was promoted to Assistant...
-
Critically critique your reading assignment for this module and point out any types of bias you may discern. Identify what type of bias and modify the statement(s) to show how you would present the...
-
KEA10. LO 16.3 Use the following excerpts from Fruitcake Company's financial records to determine net cash flows from investing activities. Acquired new plant assets Collected interest on investment...
-
An article in the financial press entitled Important Information in Annual Reports This Year noted that annual reports include a managements discussion and analysis section. What would this section...
-
Ferreri Company received the following selected information from its pension plan trustee concerning the operation of the company's defined benefit pension plan for the year ended December 31, 2017....
-
What is the average power delivered when you raise a \(2-\mathrm{kg}\) object by \(50 \mathrm{~cm}\) in \(50 \mathrm{~ms}\) ?
-
Selzik Company makes super-premium cake mixes that go through two processing departments, Blending and Packaging. The following activity was recorded in the Blending Department during July: All...
-
(a) An investor purchased 300 units of a Mutual Fund at Rs. 12.25 per unit on 31 December, 2009. As on 31st December, 2010 he has received Rs. 1.25 as dividend and Rs. 1.00 as capital gains...
-
A manufacturer of prefabricated homes has decided to subcontract four components of the homes. Several companies are interested in receiving this business, but none can handle more than one...
-
1) Why does light bend when it travels from one medium to another? 2) For what incidence angle would light not bend when passing from water to glass? 3) A ray of light is traveling through air at an...
-
What are supply shocks and from what sources can they arise? Distinguish between positive and negative supply shocks.
-
Explain each symbol or term in the Cobb-Douglas production function. Which element in the production function cannot be measured directly? How is it measured?
-
What rule do firms follow to determine how much of each input to hire in order to maximize profits?
-
Suppose an economy has total income of $8 trillion, where total labor income equals $6 trillion and capital income equals $2 trillion. Which are the values of the exponents on labor and capital using...
-
Explain how an equilibrium factor price is established in a factor market if there is either an excess demand for the factor or an excess supply of the factor.
-
Graph the set (xx>-1) on the number line. Then, write the set using interval notation. -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4567 O X ** ? {x|x>-1) = 0 0.0 0.0 0.0 0.0 0 - X ?
-
Based on the scenario described below, generate all possible association rules with values for confidence, support (for dependent), and lift. Submit your solutions in a Word document (name it...
-
Two opposing armies, Red and Blue, must each decide whether to attack or defend. These decisions are made without knowledge of the opposing army's decision. The payoff table, in terms of value of...
-
The manager at a local university bookstore wishes to apply the EOQ model to determine the respective order quantities for two products: ballpoint pens and mechanical pencils. The annual demand for...
-
Refer to the computer solution of Problem 12 in Figure 3.17. a. Identify the range of optimality for each objective function coefficient. b. Suppose the profit for the economy model is increased by...
-
What is the genetic code? a. The relationship between a three-base codon sequence and an amino acid or the end of translation b. The entire base sequence of an mRNA molecule c. The entire sequence...
-
Lets suppose a researcher mixed together nucleotides with the following percentages of bases: 30% G, 30% C, and 40% A. If RNA was made via polynucleotide phosphorylase, what percentage of the codons...
-
If a tRNA has an anticodon with the sequence 3-GAC-5, which amino acid does it carry? a. Aspartic acid c. Leucine b. Valine d. Glutamine
Study smarter with the SolutionInn App