Answered step by step
Verified Expert Solution
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 thisxInit && thisyInit
int randomNum thisrandomNumber;
if randomNum
thismoveDown;
else if randomNum
thismoveRight;
else if randomNum
thismoveDiagonalNegRight;
randomly selects the direction of the object when it's at the coordinate
if thisxInit && yInit
int randomNum thisrandomNumber;
if randomNum
thismoveUp;
else if randomNum else if randomNum randomly selects the direction of the object when it's at the coordinate
if thisxInit && yInit if randomNum else if randomNum else if randomNum randomly selects the direction of the object when it's at the coordinate
if thisxInit && yInit if randomNum else if randomNum else if randomNum randomly selects the direction of the object when it's at the coordinate 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 xRect rectangle new Rect;Rect::printObjectAmount; rectanglefGlide;delete rectangle;systempause; return ;
end main
D Flowchart draw a flow chart.
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