Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started