Question: HAS TO BE IN C + + 1 - In physics, an object that is in motion is said to have kinetic energy. The following

HAS TO BE IN C++
1- In physics, an object that is in motion is said to have kinetic energy. The following formula
can be used to determine a moving object's kinetic energy:
KE=12xmxv2
The variables in the formula are the following: KE is the kinetic energy, m is the object's mass in
kilograms, and v is the objects velocity in meters per second.
Determine the amount of kinetic energy of a cart with a mass of 30kg moving at a rate of 3ms.
KE=1230kg(3ms)2=135kg9(ms)2=135J
Write a class named KE that has the following member variables:
a. Mass. A float that holds the objects mass (in kg)
b. Velocity. A float that holds the objects velocity in meters per second
In addition, the class should have constructors, destructors, and member functions. Define the
header.
2- Define the constructor that accepts the mass and velocity as arguments.
3- Define the mutator function to store de value in mass member variable.
4- Define the accessor function to get the value stored in velocity member variable.
5- Define the member function that calculates the KE using the mutators and accessors
defined in your class.
6- Demonstrate your class in a program that creates two KE objects, using your constructor
and another asking the user to enter values for mass and velocity.
 HAS TO BE IN C++ 1- In physics, an object that

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!