Question: Based off the code attached in the picture answer the following questions: 1 ) Which code snippet correctly implements the addPoint method a ) points
Based off the code attached in the picture answer the following questions:
Which code snippet correctly implements the addPoint method
a pointscount Pointxy; count; resize;
bcount; pointscount Point xy; if count capacityresise;
c pointscount Point xy;count; if count capacityresise;
dpointscount Point xy; if count capacityresise; count;
Which code snipper correctly implements the resize method?
a void resizecapacity ; delete points; points new Pointcapacity;
b void resizecapacity ; Point old points; points new Pointcapacity; for int i ; i count; ipointsi old ii; delete old;
c void resizecapacity ; Point old points; points new Pointcapacity; delete old; for int i ; i count; ipointsi old ii;
d void resizecapacity ; Point old points; for int i ; i count; ipointsi old ii; points new Pointcapacity; delete old;
Which code snippet correctly implements the draw method?
a void draw for int i ; i count; ipointsidraw;
b void draw glBegin GLLINES; for int i ; i count; ipointsidraw; glVertexfpointsigetX pointsigetY; glVertexfpointsigetX pointsigetY; glEnd;
c void draw glBegin GLLINES; for int i ; i count; ipointsidraw glEnd;
d void draw for int i ; i count; ipointsidraw; glBegin GLLINES; glVertexfpointsigetX pointsigetY; glVertexfpointsigetX pointsigetY; glEnd;
Which code snippet correctly implements the destructor?
a ~ List delte points;
b ~ Listdelte points;
c ~List for int i ; i capacity; ideltei points;
d ~ List for int i ; i capacity; ideltei points; delete points;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
