OOP Basics
Data Members
Member Functions
Public Interface
Constructors
100

What does OOP stand for?

Object Oriented Programming

100

Where are data members declared?

In the private section

100

How many member functions can be implemented in a class?

Infinite 

100

What is a public interface?

All member functions that a user may want to apply to its objects

100

What is a constructor?

A member function that initializes the data members of an object.

200

What is the process of providing a public interface while hiding the implementation details?

Encapsulation

200

What is a data member used for?

To store information

200

Where do you declare member functions?

In public

200

What is a large part of the public interface?

Member functions

300

A string is not an object T/F

False

300

What is a data member?

A variable declared inside the class

300

Member function do not reset after being used T/F

T
300

What is a Mutator?

A member function that modifies data/changes the object that it operates on

400

What did we use before classes?

Functions

400

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;

400

What do you need to add to make an accessor member function?

const

400

how do you invoke member functions

dot notation

500

Is OOP possible in Scratch

Yes

500

All data members in an object copy must be the same T/F

False

500

Define a member function in Register called add_cash

void Register::add_cash()

500

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);

M
e
n
u