CSCE 1001 Chapter 10
CSCE 1001 Chapter 10
Defining Classes
10.1 Structures
10.2 Classes
balance
interest_rate
term
your_account.balance = 2500;
Notice that my_account.balance and your_account.balance
are different variables!
my_account.balance = my_account.balance + interest;
Example:
void get_data(CDAccount& the_account);
Uses the structure type CDAccount we saw
PersonInfo person1;
Can you
char
can hold
A description of the member functions
class DayOfYear
{
public:
void output( );
int month;
int day;
};
Member Function Declaration
{
cout << “month = “ << month
<< “, day = “ << day << endl;
}