Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Extra question 1) void f(int a=1); // forward declaration with a default value for the compilation unit void f(int a) / / definition coutfun( )

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
Extra question 1) void f(int a=1); // forward declaration with a default value for the compilation unit void f(int a) / / definition coutfun( ) ; return 0; What will be the displayed of a after main function execution? ( ) Derived : : fun( ) , x = 0 ( ) Base: : fun( ) , x = 0 Use the code snippet below to answer questions 3-5 class Base { public: void f10; virtual void f20; virtual void f30 = 0; 6 . 7 . 8 Base b; // error: pure virtual f3 not overridden class Derived : public Base { // no f1: fine // no f2: fine, we inherit Base::f2 void f30; Derived d; // ok: Derived::f3 overrides Base::f3 1. class D2 : public Base { / / no f1: fine 3 . // no f2: fine, we inherit Base:f2 4. // no f3: fine, but D2 is therefore still abstract 3; 6. D2 d; // error: pure virtual Base::f3 not overridden Extra question 3) Which function is pure virtual? () f1 ( ) f2() f3 Extra question 4) Where Is there an error in this code snippet? ( ) Derived d; -> Derived didn't declared f1 function () void f3 (); -> f3 cannot be overridden ( ) Base b; -> Base has a pure virtual function and, therefore, we cannot create an object Extra question 5) Check the false affirmation in D2 class: () There is an error: f1 not overridden () no f2: fine, we inherit Base::f2 ( ) no f3: fine, but D2 is therefore still abstract ( ) There is an error: pure virtual Base::f3 not overridden Use the code snippet below to answer questions 6-7(a-h) using namespace std; class Geeks { public : void func(int x) cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

Students also viewed these Programming questions

Question

What is the purpose of the activation layer?

Answered: 1 week ago