Q18) Suppose, we are given a class called Car that has the following 3 attributes named model (string), year (int) and price (float). The function named find_car() takes three input parameters as follows: an object my_car of Car class, a string my_model, and an int age. This function returns True if my_car's model matches the given model and my_car is not more than age years old. Otherwise it returns False Choose the best option to fill the gap on Line# 2. (my_car.my_model == model) and (2022 - my_car.age) <= year (my_car.my_model == model) or (2022 - my_car.age) <= year (my_car.model == my_model) and (2022 - my_car.year) <= age (my_model == model) and (2022 - age) <= year (my_car.model == my_model) or (2022 - my_car.year) <= age
Q18)
Suppose, we are given a class called Car that has the following 3 attributes named model (string), year (int) and price (float).
The function named find_car() takes three input parameters as follows: an object my_car of Car class, a string my_model, and an int age. This function returns True if my_car's model matches the given model and my_car is not more than age years old. Otherwise it returns False
Choose the best option to fill the gap on Line# 2.
|
(my_car.my_model == model) and (2022 - my_car.age) <= year |
|
(my_car.my_model == model) or (2022 - my_car.age) <= year |
|
(my_car.model == my_model) and (2022 - my_car.year) <= age |
|
(my_model == model) and (2022 - age) <= year |
|
(my_car.model == my_model) or (2022 - my_car.year) <= age |
![Line#1 def find_car(my_car, my_model, age):
Line#2
Line#3
Line#4
if
return True
return False](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F3701ccdd-6b03-4b7e-a781-64ee0302dca1%2Fdf056688-77e3-42cc-ac0e-19289aa7499f%2Fkpi8dvcu_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)