Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem A text file (Car_sale2.txt) with information about some cars is provided to you. This is a screenshot of the first lines with the header

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Problem A text file (Car_sale2.txt) with information about some cars is provided to you. This is a screenshot of the first lines with the header (1st line). Actually, the figure shown below is the screenshot of the same file in csv format Objectives: 1. Display the names of the available car manufacturers. 2. Calculate the total profits of each car manufacturer. 3. Calculate the total profits for all car manufacturers. 4. Calculate the average fuel efficiency of all car manufacturers. 5. Display the car that are above and below average fuel efficiency as follows: Car by fuel effeciency average Acura Integra Acura RL Audi A6 Audi A4 Audi AB S320 B5201 Cadillac Deville Buick Century Cadillac Seville Buick Park Avenue Cadillac Eldorado Buick LeSabre Cadillac Catera Acre Nick Regat Pentic Grand in Pontiac Firebird Pontiac Grand Prix Pontiac Bonneville Sa Porsche Carrera Cabrio Tayuta Tacom Toyota 4Runner Toyota Land Cruiser Serota Corolla Saturn Toyota Toyota Cory Toyota Avalon Toyota RAVA Volkswagen Gold Volkswagen Jetta Volkswagen Passat Volkswagen Cabrio Volkswagen GTI Celica Toyota RAV 6. Compute the total number of launched cars in each month. 7. Plot the result obtained in 6 as follows Monthly car launch 13 12 511 Volkswagen Golf volkswagen Det 2 of 2 6. Compute the total number of launched cars in each month 7. Plot the result obtained in 6 as follows. Monthly car launch 13 12 11 launched cars 10 7 10 Month To do: 1. Write a Python program to achieve the goals mentioned above. 2. Divide your program into several functions. Each function is used to meet a specific purpose Some recommendations: 1. Add docstrings to your functions. 2. Add comments to explain briefly your functions/steps, Submission: You must submit your program with your name and ID at the header. . Also include your ID on the name of your program. For example, HW1_12346. please use python language NNNNNNNNN 2 Notepad File Edit Format Vuw Help Manufacturer Model Sales_in_thousands year res e value Vehicle_type Acura Integra 17 16.36 Passenger 21.5 8 140 101.2 67.3 Acura TL 39 19.875 Passenger 28.4 3.2 225 108.1 78.3 Acura RL 29.725 Passenger 42 3.5 210 114.6 71.4 Audi A4 20 22.255 Passenger 23.0 1.8 150 102.6 68.2 Audi A6 19 23.555 Passenger 33 5 2.8 200 108.7 76.1 Audi AB 1 39 Passenger 62 4.2 310 113 74 BMW 328i 9 28.675 Passenger 33.4 2.8 193 107.3 68.5 BMW 528i 18 36.125 Passenger 38.9 2.8 193 111.4 70.9 Buick Century 92 12.475 Passenger 21.975 3.1 175 109 72.7 Buick Regal 39 13.74 Passenger 25.3 3.8 240 109 72.7 Buick Park Avenue 28 20.19 Passenger 31.965 3.8 285 113.8 Buick LeSabre 83 13.36 Passenger 27.885 3.8 205 112.2 73.5 Cadillac DeVille 64 22.525 Passenger 39.895 4.6 275 115.3 Cadillac Seville 16 27.1 Passenger 44.475 4.6 275 112.2 Cadillac Eldorado 7 25.725 Passenger 39.665 4.6 275 Cadillac Catera 11 18.225 Passenger 31.01 3 200 107.4 Cadillac Escalade 15 Car 46.225 5.7 255 117.5 Chevrolet Cavalier 146 9.25 Passenger 13.26 2.2 115 Chevrolet Malibu 135 11.225 Passenger 16.535 3.1 17e 107 Chevrolet Lumina 25 10.31 Passenger 18.89 3.1 175 107.5 Chevrolet Monte Carlo 43 11.525 Passenger 19.39 3.4 180 Chevrolet Camaro 26 13.025 Passenger 24.34 3.8 200 101.1 Chevrolet Corvette 18 36.225 Passenger 45.705 5.7 345 Chevrolet Prizm 32 9.125 Passenger 13.96 1.8 120 97.1 Chevrolet Metro 22 5.16 Passenger 9.235 1 55 93.1 Chevrolet Impala 108 Passenger 18.89 3.4 180 119.5 Sebring Coupe Chrysler 8 12.36 Passenger 2.5 19.84 163 33 Chrysler 14.18 Sebring Conv. 2.5 Passenger 168 24.495 Concorde 31 Chrysler 13.725 Passenger 22.245 2.7 200 Chrysler Cirrus 32 12.64 16.48 Passenger 2 108 132 LHS 13 28.34 17.325 Passenger 3.5 Chrysler 253 113 31 300M Chrysler 113 29.185 Passenger 253 3.5 76 7.75 2 Dodge 132 105 12.64 Neon 74.4 Passenger Price_in_thousands 172.4 2.639 13.2 192.9 3.517 17.2 196.6 3.85 18 178 2.998 16.4 192 3.561 18.5 198.2 3.982 23.7 176 3.197 16.6 188 3.472 18.5 194.6 3.368 17.5 196.2 3.543 17.5 74.7 206.8 3.778 200 3.591 17.5 74.5 207.2 3.978 75 201 108 75.5 200.6 70.3 194.8 3.77 77 281.2 5.572 104.1 67.9 180.9 69.4 190.4 3.051 72.5 200.9 3.33 110.5 72.7 197.9 74.1 193.2 3.5 184.5 73.6 179.7 66.7 174.3 2.398 62.6 149.4 11.895 73 200 3.389 103.7 69.7 190.9 106 69.2 193 113 74.4 209.1 71 186 2.911 74.4 207.7 3.564 74.4 197.8 3.567 174.4 2.567 12.5 2 2 1 2 1 1 3 1 3 2 1 1 1 1 1 1 inical - er year_resale_value 21.5 1.8 140 28.4 3.2 225 42 3.5 210 23.99 1.8 150 33.95 2.8 200 62 4.2 310 33.4 2.8 193 38.9 2.8 193 21.975 3.1 175 25.3 3.8 240 er 31.965 3.8 27.885 3.8 205 er 39.895 4.6 44.475 4.6 Passenger 39.665 ger 31.01 3 Car 46.225 5.7 Passenger 13.26 ger 16.535 3.1 ger 18.89 3.1 Passenger 19.39 ger 24.34 3.8 Passenger 45.705 ger 13.96 1.8 1 9.235 ger ger 18.89 3.4 Passenger 19.84 Passenger 24.495 5 Passenger 22.245 2 16.48 ger nger 28.34 3.5 nger 29.185 3.5 12.64 2 132 Vehicle_type 101.2 67.3 108.1 70.3 114.6 71.4 102.6 68.2 108.7 76.1 113 74 107.3 68.5 111.4 70.9 109 72.7 109 72.7 205 113.8 112.2 73.5 275 115.3 275 112.2 4.6 275 200 107.4 255 117.5 2.2 115 170 107 175 107.5 3.4 180 2ee 101.1 5.7 345 120 55 93.1 110.5 2.5 163 2.5 168 200 132 108 253 113 253 113 105 74.4 Price in_thousands 172 2.639 13.2 19.9 3.517 17.2 16.6 3.85 18 178 2.998 16.4 192 3.561 18.5 198.2 3.902 23.7 176 3.197 16.6 188 3.472 18.5 194.6 3.368 17.5 196.2 3.543 17.5 74.7 206.8 3.778 200 3.591 17.5 74.5 207.2 3.978 75 201 108 75.5 200.6 70.3 194.8 3.77 77 201.2 5.572 184.1 67.9 180.9 69.4 190.4 3.051 72.5 200.9 3.33 110.5 72.7 197.9 74.1 193.2 3.5 104.5 73.6 179.7 66.7 174.3 2.398 62.6 149.4 11.895 73 200 3.389 103.7 69.7 190.9 106 69.2 193 113 74.4 209.1 71 186 2.911 74.4 207.7 3.564 74.4 197.8 3.567 174.4 12.5 Engine_size Horsepower 28 Wheelbase 2/2/2012 58.28914952 25 6/3/2011 91.37977766 22 3/10/2011 91.38977933 27 18/8/2011 62.7776392 22 8/9/2011 84.5651esez 21 2/27/2012 134.6568582 24 1/29/2012 81.87786856 25 4/4/2011 83.9987238 25 11/2/2011 71.18145132 23 9/3/2011 95.63678253 18.5 24 3/23/2012 85.82848825 25 7/23/2011 84.25452581 18.5 22 2/23/2012 113.8545976 18.5 22 4/29/2011 115.6213578 3.843 19 22 11/27/2011 113.7 18 22 9/28/2011 83.48309358 30 15 4/17/2012 109.5091165 2.676 14.3 27 8/17/2011 46.36 15 25 3/19/2012 67.31446216 16.6 25 5/24/2011 69.9913956 3.34 17 27 12/22/2011 72.03 16.8 25 10/23/2011 81.11854333 3.21 19.1 22 5/12/2012 141.1 13.2 33 9/11/2011 48.2976361 10.3 45 4/13/2012 23.27627233 17 27 6/18/2011 71.83883944 2.967 15.9 24 1/16/2012 65.95 3.332 16 24 11/17/2011 69.52 3.452 17 26 6/6/2012 80.92 16 27 10/6/2011 53.56619987 17 23 5/8/2012 101.3292887 17 23 2/10/2012 101.6552441 29 12/12/2011 52.88489875 97.1 18e 2.7 2.567 UTF-8 100% Windows (CRL in 1, Col 1 ENG

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Icdt 88 2nd International Conference On Database Theory Bruges Belgium August 31 September 2 1988 Proceedings Lncs 326

Authors: Marc Gyssens ,Jan Paredaens ,Dirk Van Gucht

1st Edition

3540501711, 978-3540501718

More Books

Students also viewed these Databases questions

Question

8-6 Who poses the biggest security threat: insiders or outsiders?

Answered: 1 week ago