Answer:
seeexplaination
Step-by-step explanation:
Code(header file):
#ifndef THROTTLESHIFTLVEL_H
#define THROTTLESHIFTLVEL_H
class throttle
{
int position;
public:
throttle()
{
position = 0;
}
// specify the number of shift levels when creating objects
throttle(int level)
{
position = level;
}
void shut_off()
{
position = 0;
}
void shift(int amount)
{
if(amount >= 0)
position = position + amount;
}
double flow() const
{
return position;
}
bool is_on() const
{
if (position > 0)
return true;
else
false;
}
};
#endif
Please kindly check attachment for screenshot