Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 7 Which of the following creates a pointer variable? MagicBox> * myBoxPtr; All of these MagicBox> myBoxPtr; MagicBox> myBoxPtr; QUESTION 8 What will

image text in transcribed

QUESTION 7 Which of the following creates a pointer variable? MagicBox> * myBoxPtr; All of these MagicBox> myBoxPtr; MagicBox> " myBoxPtr; QUESTION 8 What will happen when this code segment runs? MagicBox aMagicPtr; aMagicPtr->getItem(); The program will not compile. The getltem method will return a garbage value. The memory address of the object will be returned. The program will crash. QUESTION 9 What are two situations when automatic memory management and early binding are insufficient? 1. You don't need to access an object in the function or method that creates it. 2. You want to take advantage of data hiding. 1. You need to access an object outside of the function or method that creates it. 2. You want to take advantage of inheritance. 1. You need to access an object outside of the function or method that creates it. 2. You want to take advantage of polymorphism. 1. You need to access an object in the function or method that creates it. 2. You want to take advantage of polymorphism. QUESTION 10 Which code segment correctly creates an alias to one of the game box objects? ToyBox string > * a ToyBoxPtr = new ToyBox string >(); ToyBox anotherToyBoxPtr = aToyBoxPtr; ToyBox string aToyBoxPtr = new ToyBox string >(); ToyBox string aToyBoxPtr = anotherToyBoxPtr; ToyBox string aToyBoxPtr = new ToyBox string >(); ToyBox string > * anotherToyBoxPtr = new ToyBox string >(); aToyBoxPtr = anotherToyBoxPtr; ToyBox string > aToyBoxPtr = new ToyBox string >(); ToyBox string anotherToyBoxPtr = new aToyBoxPtr string > ()

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

More Books

Students also viewed these Databases questions

Question

Find the derivative of y= cos cos (x + 2x)

Answered: 1 week ago

Question

3. An overview of the key behaviors is presented.

Answered: 1 week ago

Question

2. The model is credible to the trainees.

Answered: 1 week ago