Question
DESIGN AND IMPLEMENTATION OF PROGRAMMING LANGUAGES JUST I NEED THE ANSWER A OR B OR C OR D OR E PLEASE WITHOUT EXPLAIN OR ANY
DESIGN AND IMPLEMENTATION OF PROGRAMMING LANGUAGES
JUST I NEED THE ANSWER A OR B OR C OR D OR E PLEASE WITHOUT EXPLAIN OR ANY JUST THE ANSWER
Question 21 : Consider the following two program segments: S1 and S2 S1: Base class: class rational { error() { cout
a) Considering S1, A.error()
b) Considering S2: A.error()
c) a and b.
d) In S1 and S2, if error is called, Rational is always printed.
e) none of the mentioned.
---------------------------------------------------------------------------------------------------------------------------------
Question 25 : Assuming static scope, the non local referencing environment at statement1 and statement2 for the following program segment are: Main Var X, Y, Z : real procedure M1( X: real); Var D: real begin M1; call N2 (Y); statement1 end M1; procedure N2( C real); Var D, B: real; begin N2; statement2 end N2; begin main; call MI(A); end main
a) At statement1: Main; M1;N2; Y;Z At Statement2 Main;M1; N2;X;Y;Z.
b) At statement1: Main; M1; N2;Y;Z. At statement2 N2;M1;X.
c) a and b.
d) At Statement1: N2; X; B. At statement2: N2;main;Z.
e) None of the mentioned.
001010 111101101 0101010111111 101010101010 11101010101 2101100 Question 21: Consider the following two program segments: S1 and S2 S1: Base class: class rational { error() { cout ];} ... } Derived class: class complex: rational { string name() { return "Complex "> ;} ... } rational A; complex B; S2: Same as S1, but name is defined as: virtual string name() { return " Rational ";} What is the correct answer? a) Considering S1, A.error()Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started