UML Class diagram辅导、讲解Python编程设计、Python语言辅导、辅导test_vehicle
- 首页 >> 其他 Sample Question 1
Based on the simplified UML Class diagram below, implement the specified classes and
associations. Note that the attributes and methods are not complete in the diagram. You need
to identify the instance variables and also provide a getter and setter method for each.
The required files are:
abstract_vehicle.py
car.py
truck.py
test_vehicle.py
Notes:
The get_details() method is an abstract method in the AbstractVehicle class.
Make sure to follow best practices for naming and documentation in your classes.
Your modules must successfully run.
The test_vehicle module is a Python script that generates the following output (i.e., get_details
method) from your four instances of your child classes when run:
Car: 2014 Toyota Camry in excellent condition with 50000 km.
Truck: 2018 Ford Explorer in fair condition with 5500 km.
Car: 2016 VW Jetta in perfect condition with 26100 km.
Truck: 1990 Ford Ranger in poor conditions with 350000 km.
AbstractVehicle
+ get_details() : string
Car
+ get_details() : string
Truck
+ get_details()Sample Question 2
Based on the simplified UML Class diagram below, implement the specified classes and
associations. Note that the attributes and methods are not complete in the diagram. You need
to identify the instance variables and also provide a getter method for each (as appropriate).
The required files are:
school.py
student.py
test_script.py
Notes:
Make sure to follow best practices for naming and documentation in your classes.
Your modules must successfully run.
The test_script module is a Python script that generates the following output (i.e., print_details
method) from an instance of your School class when run:
The Computing School at BCIT has the following registered
students:
Bill Smith (Id: 101) graduating in Winter 2019
Susan Chang (Id: 201) graduating in Fall 2019
Sam Jones (Id: 155) graduating in Winter 2020
The Computing School at BCIT has the following registered
students:
Bill Smith (Id: 101) graduating in Winter 2019
Sam Jones (Id: 155) graduating in Winter 2020
The Computing School at BCIT has no registered students.
Based on the simplified UML Class diagram below, implement the specified classes and
associations. Note that the attributes and methods are not complete in the diagram. You need
to identify the instance variables and also provide a getter and setter method for each.
The required files are:
abstract_vehicle.py
car.py
truck.py
test_vehicle.py
Notes:
The get_details() method is an abstract method in the AbstractVehicle class.
Make sure to follow best practices for naming and documentation in your classes.
Your modules must successfully run.
The test_vehicle module is a Python script that generates the following output (i.e., get_details
method) from your four instances of your child classes when run:
Car: 2014 Toyota Camry in excellent condition with 50000 km.
Truck: 2018 Ford Explorer in fair condition with 5500 km.
Car: 2016 VW Jetta in perfect condition with 26100 km.
Truck: 1990 Ford Ranger in poor conditions with 350000 km.
AbstractVehicle
+ get_details() : string
Car
+ get_details() : string
Truck
+ get_details()Sample Question 2
Based on the simplified UML Class diagram below, implement the specified classes and
associations. Note that the attributes and methods are not complete in the diagram. You need
to identify the instance variables and also provide a getter method for each (as appropriate).
The required files are:
school.py
student.py
test_script.py
Notes:
Make sure to follow best practices for naming and documentation in your classes.
Your modules must successfully run.
The test_script module is a Python script that generates the following output (i.e., print_details
method) from an instance of your School class when run:
The Computing School at BCIT has the following registered
students:
Bill Smith (Id: 101) graduating in Winter 2019
Susan Chang (Id: 201) graduating in Fall 2019
Sam Jones (Id: 155) graduating in Winter 2020
The Computing School at BCIT has the following registered
students:
Bill Smith (Id: 101) graduating in Winter 2019
Sam Jones (Id: 155) graduating in Winter 2020
The Computing School at BCIT has no registered students.