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

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter3: Performing Calculations With Formulas And Functions
Section: Chapter Questions
Problem 3.10CP
icon
Related questions
Question
100%

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
Transcribed Image Text:Line#1 def find_car(my_car, my_model, age): Line#2 Line#3 Line#4 if return True return False
Expert Solution
steps

Step by step

Solved in 3 steps

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
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT