Question

using object oriented programming, write a program that will evaluate the oldest vehicle, and the vehicle...

using object oriented programming, write a program that will evaluate the oldest vehicle, and the vehicle with the most mileage. you can use the get_biggest_number() function for that, then print the following:

The oldest car is from { }

The highest mileage is { } miles

Given:

Car_id = [1,2,3,4,50]

Car_maker = ["Ford", "Honda", "Dodge", "FIat", "BMW"]

Car_year = ["2019", "2017", "2015", "2013", "2011"]

Car_mileage = [20000, 30000, 10000, 50000, 80000]

if somone could help me out with this, thatd be great, cuz i cant figure it out for the life of me. this is a python based code

0 0
Add a comment Improve this question Transcribed image text
Answer #1

"""
  Python program for parallel array
"""

Car_id = [1,2,3,4,50]
Car_maker = ["Ford", "Honda", "Dodge", "FIat", "BMW"]
Car_year = ["2019", "2017", "2015", "2013", "2011"]
Car_mileage = [20000, 30000, 10000, 50000, 80000]

def get_biggest_number():
  return Car_id.index(max(Car_id))

def get_oldest_car():
  return Car_year.index(min(Car_year))

def get_highest_mileage():
  return Car_mileage.index(max(Car_mileage))


print("The oldest car is from {}".format(Car_maker[get_oldest_car()]))

print("The highest mileage is {} miles for {}".format(Car_mileage[get_oldest_car()], Car_maker[get_oldest_car()]))

Note: no sample output was attached so the program's output may not be desired for you. Please provide a sample output or instructions for the proper output format.

Add a comment
Know the answer?
Add Answer to:
using object oriented programming, write a program that will evaluate the oldest vehicle, and the vehicle...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • HELLO, PLEASE TAKE TIME TO ANSWER THIS QUESTION. PLESE ENSURE ITS CORRECT AND SHOW THAT THE...

    HELLO, PLEASE TAKE TIME TO ANSWER THIS QUESTION. PLESE ENSURE ITS CORRECT AND SHOW THAT THE PROGRAM RUNS. Task 1: Enforcing const-ness throughout Your first job will be to go through all of the code and decide which functions should be declared const. You should find several places throughout the program where this makes sense. We will also make the id data member in the Customer class const , as once a customer has been created their ID will never...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT