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
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:
The variables in the formula are the following: is the kinetic energy, is the object's mass in
kilograms, and is the objects velocity in meters per second.
Determine the amount of kinetic energy of a cart with a mass of moving at a rate of
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.
Define the constructor that accepts the mass and velocity as arguments.
Define the mutator function to store de value in mass member variable.
Define the accessor function to get the value stored in velocity member variable.
Define the member function that calculates the using the mutators and accessors
defined in your class.
Demonstrate your class in a program that creates two objects, using your constructor
and another asking the user to enter values for mass and velocity.
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
