What does OOP stand for?
Object Oriented Programming
Where are data members declared?
In the private section
How many member functions can be implemented in a class?
Infinite
What is a public interface?
All member functions that a user may want to apply to its objects
What is a constructor?
A member function that initializes the data members of an object.
What is the process of providing a public interface while hiding the implementation details?
Encapsulation
What is a data member used for?
To store information
Where do you declare member functions?
In public
What is a large part of the public interface?
Member functions
A string is not an object T/F
False
What is a data member?
A variable declared inside the class
Member function do not reset after being used T/F
What is a Mutator?
A member function that modifies data/changes the object that it operates on
What did we use before classes?
Functions
Identify the data member
private:
string first_name;
string last_name;
int start_year;
int salary;
string job;
};
Employee::Employee()
{
first_name = " ";
last_name = " ";
start_year = 0;
salary = 0;
job = " ";
}
void Employee::set_job(string job){
this->job = job;
}
All of the below
string first_name; string last_name;
int start_year; int salary; string job;
What do you need to add to make an accessor member function?
const
how do you invoke member functions
dot notation
Is OOP possible in Scratch
Yes
All data members in an object copy must be the same T/F
False
Define a member function in Register called add_cash
void Register::add_cash()
Identify the public interface
#include <iostream>
using namespace std;
class Employee
{
public:
Employee();
void set_first_name(string first_name);
void set_last_name(string last_name);
void set_first_name(string first_name);
void set_last_name(string last_name);