Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

B . With a static variable it counts how many objects have been created and then decrements when an object is destroyed. void Rect::fGlide (

B. With a static variable it counts how many objects have been created and then decrements
when an object is destroyed.
void Rect::fGlide(){
if (this->xInit ==0&& this->yInit ==0
int randomNum = this->randomNumber();
if (randomNum ==1)
this->moveDown();
else if (randomNum ==2)
this->moveRight();
else if (randomNum ==3)
this->moveDiagonalNegRight();
}??? randomly selects the direction of the object when it's at the coordinate (0,0)
if (this->xInit =600&& yInit =500
int randomNum = this->randomNumber();
if (randomNum ==1)
this->moveUp();
else if (randomNum ==2) else if (randomNum ==3)}//randomly selects the direction of the object when it's at the coordinate (600,500)
if (this->xInit ==600 && yInit ==0){ if (randomNum ==1) else if (randomNum ==2) else if (randomNum ==3)}//randomly selects the direction of the object when it's at the coordinate (600,0)
if (this->xInit ==0 && yInit ==500){if (randomNum ==1) else if (randomNum ==2) else if (randomNum ==3)}//randomly selects the direction of the object when it's at the coordinate (600,0)C. In main, Rect class objects were changed to heap pointers with the new and delete
commands. Two pointers are created to have two objects to be painted on the console..//Hace que la pantalla mida 600x500Rect *rectangle 1= new Rect;Rect::printObjectAmount(); (rectangle1)->fGlide();}delete rectangle2;system("pause"); return 0 ;
}//end main
D. Flowchart / draw a flow chart.
image text in transcribed

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

9. Why do many firms strive to maintain stable prices? LO26.5

Answered: 1 week ago