For this lab, you need to write a Python program to do the following. 1. Write your program to do the following: ● ● ● ● ● ● ● ● Print out your name and date as the beginning of the program (see your lab1) Prompt user for the tank's capacity in gallons Prompt user for miles_per_gallon Prompt user to enter gas price per gallon. Cost = 100/miles_per_gallon * gas_price Distance = capacity * miles_per_gallon Print cost and efficiency Use a SIGLE if elif... else statement to print out the following: MPG is less than 30: print out "It is not fuel efficient car." MPG is between 30 and 40, "It is average fuel efficient car." O

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

To do what is inside the sheets.

CNET-142 - Introduction to Python
Lab 2- Calculate car efficiency
For all the lab assignments in this class, you CAN'T use any online Python compiler. You MUST use one of the Python
compilers/interpreters you have installed on your local computer system. Some of the locally installed Python
compilers/interpreters are: Python IDLE, Pycharm and Microsoft Visual Studio Code Python.
Regardless which one you use, you must able to save the complete python file (.py file) to be submitted as part of the
lab.
IDLE is the easiest to use and it is already installed when you install Python on your system.
For this lab, you need to write a Python program to do the following.
1. Write your program to do the following:
●
●
●
●
●
●
●
Print out your name and date as the beginning of the program (see your lab1)
Prompt user for the tank's capacity in gallons
Prompt user for miles_per_gallon
Prompt user to enter gas price per gallon.
Cost 100 miles_per_gallon * gas_price
Distance
capacity * miles_per_gallon
Print cost and efficiency
Use a SIGLE if elif... else statement to print out the following:
MPG is less than 30: print out "It is not fuel efficient car."
MPG is between 30 and 40, "It is average fuel efficient car."
MPG is between 40 and 50, "It is fuel efficient car"
MPG is greater than 50, "It is very fuel efficient car"
O
=
For user's input: YOU MUST USE the following input as test case:
Test case #1:
=
capacity: 18.5
miles per gallon: 33
price per gallon: 3.89
CNET-142: Ron Sha Lab 2: Car Mileage
2021-03-29 11:02:27
Enter the capacity of the car's gas tank (in gallons): 18.5
Enter car's miles per gallon: 33
Enter price per gallon: 3.89
Cost for driving 100 miles is $11.79
Distance on a tank of gas is
Your car MPG is 33.0. It is average fuel efficient car.
610.50 miles
Transcribed Image Text:CNET-142 - Introduction to Python Lab 2- Calculate car efficiency For all the lab assignments in this class, you CAN'T use any online Python compiler. You MUST use one of the Python compilers/interpreters you have installed on your local computer system. Some of the locally installed Python compilers/interpreters are: Python IDLE, Pycharm and Microsoft Visual Studio Code Python. Regardless which one you use, you must able to save the complete python file (.py file) to be submitted as part of the lab. IDLE is the easiest to use and it is already installed when you install Python on your system. For this lab, you need to write a Python program to do the following. 1. Write your program to do the following: ● ● ● ● ● ● ● Print out your name and date as the beginning of the program (see your lab1) Prompt user for the tank's capacity in gallons Prompt user for miles_per_gallon Prompt user to enter gas price per gallon. Cost 100 miles_per_gallon * gas_price Distance capacity * miles_per_gallon Print cost and efficiency Use a SIGLE if elif... else statement to print out the following: MPG is less than 30: print out "It is not fuel efficient car." MPG is between 30 and 40, "It is average fuel efficient car." MPG is between 40 and 50, "It is fuel efficient car" MPG is greater than 50, "It is very fuel efficient car" O = For user's input: YOU MUST USE the following input as test case: Test case #1: = capacity: 18.5 miles per gallon: 33 price per gallon: 3.89 CNET-142: Ron Sha Lab 2: Car Mileage 2021-03-29 11:02:27 Enter the capacity of the car's gas tank (in gallons): 18.5 Enter car's miles per gallon: 33 Enter price per gallon: 3.89 Cost for driving 100 miles is $11.79 Distance on a tank of gas is Your car MPG is 33.0. It is average fuel efficient car. 610.50 miles
CNET-142-Introduction to Python
Test case #2:
capacity: 18.5
· miles per gallon: 45
price per gallon: 3.89
•
CNET-142: Ron Sha Lab 2: Car Mileage
2021-03-29 11:03:31
Enter the capacity of the car's gas tank (in gallons): 18.5
Enter car's miles per gallon: 45
Enter price per gallon: 3.89
Cost for driving 100 miles is $ 8.64
Distance on a tank of gas is 832.50 miles
Your car MPG is 45.0.
Test case #3:
. capacity: 18.5
·
•
miles per gallon: 60
price per gallon: 3.89
It is fuel efficient car.
After you run your program, it should have output similar to the one below:
CNET-142: Ron Sha Lab 2: Car Mileage
2021-03-29 11:04:02
Enter the capacity of the car's gas tank (in gallons): 18.5
Enter car's miles per gallon: 60
Enter price per gallon: 3.89
Cost for driving 100 miles is $ 6.48
Distance on a tank of gas is 1110.00 miles.
Your car MPG is 60.0.
It is very fuel efficient car.
Transcribed Image Text:CNET-142-Introduction to Python Test case #2: capacity: 18.5 · miles per gallon: 45 price per gallon: 3.89 • CNET-142: Ron Sha Lab 2: Car Mileage 2021-03-29 11:03:31 Enter the capacity of the car's gas tank (in gallons): 18.5 Enter car's miles per gallon: 45 Enter price per gallon: 3.89 Cost for driving 100 miles is $ 8.64 Distance on a tank of gas is 832.50 miles Your car MPG is 45.0. Test case #3: . capacity: 18.5 · • miles per gallon: 60 price per gallon: 3.89 It is fuel efficient car. After you run your program, it should have output similar to the one below: CNET-142: Ron Sha Lab 2: Car Mileage 2021-03-29 11:04:02 Enter the capacity of the car's gas tank (in gallons): 18.5 Enter car's miles per gallon: 60 Enter price per gallon: 3.89 Cost for driving 100 miles is $ 6.48 Distance on a tank of gas is 1110.00 miles. Your car MPG is 60.0. It is very fuel efficient car.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education