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. Line#1 def find_car(my_car, my_model, age): Line#2 : Line#3 Line#4 if return True return False Choose the best option to fill the gap on Line# 2. (my_car.model my_model) or (2022 (my_car.my_model == model) or (2022 (my model model) and (2022 age) (my car.model == my_model) and (2022 == == - - my_car.year) <= age my_car.age) <= year <= year - my_car.year) <= age

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter12: Adding Functionality To Your Classes
Section12.2: Providing Class Conversion Capabilities
Problem 2E
icon
Related questions
Question
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.
Line#1 def find_car(my_car, my_model, age):
Line#2
Line#3
Line#4
if
return True
return False
Choose the best option to fill the gap on Line# 2.
(my_car.model
my model) or (2022
my_car.year) <= age
(my_car.my_model model) or (2022 - my_car.age) <= year
(my model
model) and (2022 - age)
<= year
(my_car.model
my_model) and (2022
==
==
==
=
-
my_car.year) <= age
Transcribed Image Text: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. Line#1 def find_car(my_car, my_model, age): Line#2 Line#3 Line#4 if return True return False Choose the best option to fill the gap on Line# 2. (my_car.model my model) or (2022 my_car.year) <= age (my_car.my_model model) or (2022 - my_car.age) <= year (my model model) and (2022 - age) <= year (my_car.model my_model) and (2022 == == == = - my_car.year) <= age
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Variables
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr