Unit 5 AP Computer Science Practice Exam
Unit 5 AP Computer Science Practice Exam
Writing Classes
1) This question involves the implementation of a Train class. A Train object is created
with two parameters that specify the name of the train, and if the train is diesel or not.
This constructor initializes a Train object with the name of “Thomas” and it not
being having a diesel engine, as well as the number of passengers to 0.
//fields
//methods
//constructor
END OF SECTION I