Common Computer Science References
At the end of this lesson, you will be able to:
understand encapsulation and constructors
review "UML" & "Class Diagrams"
read "Using OOP", Chapter 9, Computer Based Problem Solving
read "Encapsulation" & "Constructors"
see how constructors are used in typescript
see how constructors are used in Java
taken from this book: Head First: Object-Oriented Analysis & Design
or here
read over and do the questions asked in Lesson 1 below
do the Airplane class in Java code only
once done, then look at Lesson 2 and the answers
create a new program that has a class "Vehicle". All vehicles have the following properties:
License plate number (getter and setter)
Colour (getter and setter)
# of doors (ReadOnly Property)
Speed (ReadOnly Property)
Maximum speed (ReadOnly Property)
they also have 3 "Public" methods:
have the class also have a constructor (that sets the initial state of the fields that a user can choose; things the user can not choose are just set to that value; you need to decide what these are!)
for example, when a vehicle is made is the colour decided by a user?
when a vehicle is made what is the current speed?
create the Vehicle Class Diagram that has the above 5 private fields and 2 public methods
then create the class in code
create the Vehicle class to go along with my index.ts code below!
YES, you just have to create the class, BUT your output MUST match mine exactly!
do the above in a second language
Required output