Answered step by step
Verified Expert Solution
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
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
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