Suppose a program has the following class declaration: class CheckPoint {private: int a;protected: int b; int c;void setA(int x) { a = x;} public:void setB(int y) { b = y;} void setC(int z) { c = z;}}; Answer the following questions.A) Suppose another class, Quiz, is derived from the CheckPoint class. Here is the first line of its declaration:class Quiz : private CheckPointIndicate whether each member of the CheckPoint class is private, protected, public, or inaccessible:abcsetAsetBsetCB) Suppose the Quiz class, derived from the CheckPoint class, is declared as class Quiz : protected CheckpointIndicate whether each member of the CheckPoint class is private, protected, public, or inaccessible:abcsetAsetBsetCC) Suppose the Quiz class, derived from the CheckPoint class, is declared as class Quiz : public Checkpoint Indicate whether each member of the CheckPoint class is private, protected, public, or inaccessible:abcsetAsetBsetCD) Suppose the Quiz class, derived from the CheckPoint class, is declared asclass Quiz : CheckpointIs the CheckPoint class a private, public, or protected base class?

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

Suppose a program has the following class declaration:

class CheckPoint

{
private: int a;
protected: int b; int c;
void setA(int x) { a = x;} public:
void setB(int y) { b = y;} void setC(int z) { c = z;}
};

Answer the following questions.
A) Suppose another class, Quiz, is derived from the CheckPoint class. Here is the first line of its declaration:
class Quiz : private CheckPoint
Indicate whether each member of the CheckPoint class is private, protected, public, or inaccessible:
a
b
c
setA
setB
setC
B) Suppose the Quiz class, derived from the CheckPoint class, is declared as class Quiz : protected Checkpoint
Indicate whether each member of the CheckPoint class is private, protected, public, or inaccessible:
a
b
c
setA
setB
setC
C) Suppose the Quiz class, derived from the CheckPoint class, is declared as class Quiz : public Checkpoint

Indicate whether each member of the CheckPoint class is private, protected, public, or inaccessible:
a
b
c
setA
setB
setC
D) Suppose the Quiz class, derived from the CheckPoint class, is declared as
class Quiz : Checkpoint
Is the CheckPoint class a private, public, or protected base class?

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning