Question: please write the code Task 6: Understanding constructors. The constructor Ballo) does not allow the user of the class to choose a custom initial position

 please write the code Task 6: Understanding constructors. The constructor Ballo)
does not allow the user of the class to choose a custom
initial position or velocity of the ball. Design an alternative constructor that
please write the code

Task 6: Understanding constructors. The constructor Ballo) does not allow the user of the class to choose a custom initial position or velocity of the ball. Design an alternative constructor that would allow to do so upon class instantiation. #include "ball.h" 6 7 00 #include Ball:: Ball : r(0.1), x(), y(0), vx(0.3), vy(-0.1), g(9.8), m(1), xmin(-1), xmax(1), ymin(-1), ymax (1) {} 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 void Ball::step(double dt) { double xp = x + vx * dt ; double yp = y + vy * dt - 0.5 * g * dt * dt; if (xmin + r

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!