lecture-8a - Using Data Members and Member Functions •...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Object Oriented Programming – Introduction to C++ R.B. Lenin Winter 2006 DA -I I C T 50 Using Data Members and Member Functions • Classes provide public member functions – Set (i.e., write) or get (i.e., read) values of private data members – Relevant names to member functions • Adjustment of bank balance (a private data member of class BankAccount ) by member function computeInterest •N a m i n g – Member function that set s interestRate typically named setInterestRate – Member function that get s interestRate would typically be
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object Oriented Programming – Introduction to C++ R.B. Lenin Winter 2006 DA -I I C T 51 Using Data Members and Member Functions (II) •D o set and get capabilities effectively make data members public ? –N o ! – Programmer decides what the function can set and what information the function can get
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/15/2010 for the course CSE IT325 taught by Professor Maniklaldas during the Spring '09 term at Punjab Engineering College.

Page1 / 12

lecture-8a - Using Data Members and Member Functions •...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online