Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

---------------------------------------------------------------------------------------------------------------------------------

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.

image text in transcribed

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

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

Practical Database Programming With Visual Basic.NET

Authors: Ying Bai

1st Edition

0521712351, 978-0521712354

More Books

Students also viewed these Databases questions

Question

1. What is Ebola ? 2.Heart is a muscle? 3. Artificial lighting?

Answered: 1 week ago