Class

How do i do this- create two derived classes that will inherit data from your base class? Base class underneath.



#include <iostream>
#include <iomanip>

using namespace std;
class dirtbike

{

private:
int manufacturer;
int motor size;
int top speed;

public:
dirt bike(int=yamaha, int=250, int=90);
void showdirtbike();
};

dirtbike::dirtbike(int man, int ms, int ts)
{
manufacturer= man;
motor size= ms;
top speed= ts;
}

void dirtbike::showdirtbike()
{
Cout<< “The dirtbikes”;
Cout<< manufacturer << “ manufacturer ”
<< motor size << “ and ”
<< top speed << “ makes up the dirtbike ”<< endl;

return0;
}
Topic archived. No new replies allowed.