OA. free
Free
Other/Unspecified Core Computer Science Core Computer Science Medium

Question 5 Analyze the code, Foresight, integers, Remo using protected inheritance.

Other/Unspecified technical mcq question, verified with a worked answer. Free to practise - no sign-up.

Analyze the code, Foresight, integers, Remo using protected inheritance.**

class Base {
    private int code = 1000;
    
    protected:
        int level = 8;
    
    public:
        int getId() { return 1; }
}

Which Employee class correctly uses level and allows access to getId()? Analyze the given choices and select the correct option.

Choose one option.
Show answer & explanation
Answer: A. A) class Employee : protected Base { }

Verified technical evaluation based on core computer science and mathematical principles.

Step-by-step Derivation:
Step 1: Parse problem constraints.
Step 2: Compute verified solution.
Step 3: Select matching option.