python
Problem 1: Car Class
- Write a class named
Carthat has the following data attributes:
__year_model(for the car’s year model)__make(for the make of the car)__speed(for the car’s current speed)- The
Carclass should have an__init__method that accepts the car’s year model and make as arguments. These values should be assigned to the object’s__year_modeland__makedata attributes. It should also assign 0 to the__speeddata attribute.
The class should also have the following methods:
accelerate
Theacceleratemethod should add 5 to the speed data attribute each time it is called.brake
Thebrakemethod should subtract 5 from the speed data attribute each time it is called.get_speed
Theget_speedmethod should return the current speed.- Next, design a program that creates a
Carobject and then calls theacceleratemethod five times. After each call to theacceleratemethod, get the current speed of the car and display it. Then call thebrakemethod five times. After each call to thebrakemethod, get the current speed of the car and display it.
Problem 2: Personal Information Class
- Design a class that holds the following personal data: name, address, age, and phone number. Write appropriate accessor and mutator methods. Also, write a program that creates three instances of the class. One instance should hold your information, and the other two should hold your friends’ or family members’ information.
9 years ago
10
Answer(1)![blurred-text]()
![]()
Purchase the answer to view it

NOT RATED
- problem-1.py
- problem2.py
other Questions(10)
- assignment 3 human resources
- The Effects of War and Peace on Foreign Aid
- English homework
- LEG 100
- Art History Homework 2
- Hello i need help in chemistry
- Using IT Collaboration Technologies
- AC Electrical Appliance/Product Failure Research Paper
- . The goal of Business Intelligence systems is to provide decision makers with analytics, or quantitative measures of performance, to...
- writing paper