






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Notes; Professor: Miller; Class: Object Oriented Programming for Engineers; Subject: Computer Systems Engineering ; University: University of Alaska - Anchorage; Term: Spring 2009;
Typology: Study notes
1 / 10
This page cannot be seen from the preview
Don't miss anything!
Object-Oriented C++ Programming for Engineers
Lecture #8 Jeffrey Miller, Ph.D.
-^ To drive a car, you need the accelerator pedal, thebrake pedal, the steering wheel, and the ignition(at minimum) •^ But what actually happens when you turn the keyin the ignition?^ –^ Most drivers do not know, but they do not need toknow to be able to drive the car •^ This is the idea behind objects^ –^ The code that uses the object knows
what^ the function will do, but does not need to know
how^ it does it
-^ There are two access specifiers in C++^ –^ public^ –^ private •^ If a variable or function is declared public, any other pieceof code can access the variable or function •^ If a variable or function is declared private, only the classin which that variable or function is declared can access it •^ Rule of Thumb – Hide the data and expose the necessaryfunctions
-^ A class is considered
encapsulated
if all of
the data is declared private • A class is considered
fully encapsulated
if
all of the data is declared private AND youprovide an accessor (getter) andmanipulator (setter) function for each pieceof data^ –^ Manipulators are also called mutators
-^ Homework #3 is posted!