Question: Pls explain step by step code For the following, your answers should be the code segments that you are asked to write down with correct

Pls explain step by step code
For the following, your answers should be the code segments that you are asked to write down with correct C++ syntax. You should test these solutions by executing your code and obtaining expected answers.
[5 points] We intend to model particles that are spheres of diameter d. In the PARTICLE class, add the diameter as a member. Provide the code modification.
[10 points] Code two separate member functions in the PARTICLE class that evaluate the surface area and volume of the spherical particle (these are functions of the newly added member in the above question). Provide the codes for these two member functions.
[10 points] Create a tennis ball of type PARTICLE with mass m=55 grams. Assign any reasonable initial position and typical diameter to the ball. The initial velocity vector of the tennis ball is vec(v)=(160,0,0) kilometers per hour. Write a member function in the PARTICLE class that calculates the kinetic energy of the tennis ball in Joules. Provide the code segment, and the value of the kinetic energy you obtained? Make sure to do proper unit conversions.
#ifndef _VECTOR3D_H
#define _VECTOR3D_H
#includex,y,z=0.0=0.0x=y=z=rr=x**x+y**y+z**z2;rvv(x+v*x,y+v*y,z+v*z)
 Pls explain step by step code For the following, your answers

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!