Jsing the created Car class, perform the followings: read the cars.txt to create Car objects from each line, store them in a list, print all cars in the list using the string() function in the Car class. Write a function filter_increase() that takes four parameters, a list that has Car objects, max_km, min_year and rate. This function only updates prices of the Car objects based in the list based on the maximum kilometer (exclusive, i.e. < max_km) and minimum production year (exclusive, i.e. > min_year) and prints these updated objects by using string() method.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Language: PYTHON 

Using the created Car class, perform the followings:
read the cars.txt to create Car objects from each line,
store them in a list,
print all cars in the list using the string() function in the Car class.
Write a function filter_increase() that takes four parameters, a list that has Car objects, max_km,
min_year and rate. This function only updates prices of the Car objects based in the list based on the
maximum kilometer (exclusive, i.e. < max_km) and minimum production year (exclusive, i.e. >
min_year) and prints these updated objects by using string() method.
Write the Python statements to perform the followings:
Input a maximum km value,
Input a minimum year,
Input increase rate in percents,
Call filter_increase() function to increase prices and print the relevant cars.
Transcribed Image Text:Using the created Car class, perform the followings: read the cars.txt to create Car objects from each line, store them in a list, print all cars in the list using the string() function in the Car class. Write a function filter_increase() that takes four parameters, a list that has Car objects, max_km, min_year and rate. This function only updates prices of the Car objects based in the list based on the maximum kilometer (exclusive, i.e. < max_km) and minimum production year (exclusive, i.e. > min_year) and prints these updated objects by using string() method. Write the Python statements to perform the followings: Input a maximum km value, Input a minimum year, Input increase rate in percents, Call filter_increase() function to increase prices and print the relevant cars.
cars (1).txt - Not Defteri
Dosya Düzen Biçim Görünüm Yardım
þ6AT1250
Toyota
Corolla Red
2016
44000
48000
34GG784 Audi
А4
Dark Green
2019
24000
74560
Blue
Peugeot 107
Gray
06AD2876
2012
88600
48000
16HN177 Renault Symbol
2019
26000
58000
24HT1404
BMW
X2
Black
2014
60000
112000
45DL270 Renault clio Symbol
Black
2016
31800
64000
06HYR84 Citroen C2
Red
2006
212000
16400
07EE007 Mercedes
E 220
white
2020
44000
432000
Carina Blue
Тoyota
Linea
Ø7BT1204
2018
39800
64000
34HJ807 Fiat
white
2007
144000
16800
Renault Megane Blue
Renault Laguna Red
07ANT240
2020
72000
56000
06KLM081
2016
2400
126000
06RR440 Fiat
Panda
Red
2013
106200
30400
34LL1402
Citroen C4
Gray
Red
2015
64000
50000
28GG147 Alfa Romeo
147-5
2016
62000
119200
26AR3420
BMW
X3
white
2019
44000
136000
06HH147 Mercedes
E 220
Brown
2016
194000
132000
05PA404 Anadol A
white
1984
136000
14000
06YT196 Ford
23000
Gray
34KL254 citroen C4 Sedan
Focus
2018
64800
Blue
2015
8800
84000
Ø6RE440 Renault Megane
white
2016
38000
70400
34UT482 Mazda
626
Metallic Blue
2017
19000
88000
01UY254 Toyota Corolla Red
51ND248 Renault Symbol
35T1881 Toyota Yaris
04NN548 Honda
2012
89240
16400
Blue
2017
36800
58400
white
2019
84000
36000
Civic
Red
2018
120400
46800
07ATA777
Renault Megane Red
2012
88000
64000
67SON99 Toyota Auris
24TY714 Renault Megane
Dark Blue
2017
12000
84000
Blue
2018
14600
128000
Transcribed Image Text:cars (1).txt - Not Defteri Dosya Düzen Biçim Görünüm Yardım þ6AT1250 Toyota Corolla Red 2016 44000 48000 34GG784 Audi А4 Dark Green 2019 24000 74560 Blue Peugeot 107 Gray 06AD2876 2012 88600 48000 16HN177 Renault Symbol 2019 26000 58000 24HT1404 BMW X2 Black 2014 60000 112000 45DL270 Renault clio Symbol Black 2016 31800 64000 06HYR84 Citroen C2 Red 2006 212000 16400 07EE007 Mercedes E 220 white 2020 44000 432000 Carina Blue Тoyota Linea Ø7BT1204 2018 39800 64000 34HJ807 Fiat white 2007 144000 16800 Renault Megane Blue Renault Laguna Red 07ANT240 2020 72000 56000 06KLM081 2016 2400 126000 06RR440 Fiat Panda Red 2013 106200 30400 34LL1402 Citroen C4 Gray Red 2015 64000 50000 28GG147 Alfa Romeo 147-5 2016 62000 119200 26AR3420 BMW X3 white 2019 44000 136000 06HH147 Mercedes E 220 Brown 2016 194000 132000 05PA404 Anadol A white 1984 136000 14000 06YT196 Ford 23000 Gray 34KL254 citroen C4 Sedan Focus 2018 64800 Blue 2015 8800 84000 Ø6RE440 Renault Megane white 2016 38000 70400 34UT482 Mazda 626 Metallic Blue 2017 19000 88000 01UY254 Toyota Corolla Red 51ND248 Renault Symbol 35T1881 Toyota Yaris 04NN548 Honda 2012 89240 16400 Blue 2017 36800 58400 white 2019 84000 36000 Civic Red 2018 120400 46800 07ATA777 Renault Megane Red 2012 88000 64000 67SON99 Toyota Auris 24TY714 Renault Megane Dark Blue 2017 12000 84000 Blue 2018 14600 128000
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY