I am having problems with the . operator I thought i had it right but it keeps giving me problems on the line myBike.Bicycle(24,17); it won't compile.
// This program is designed to imput data and
// output the data for bike gear and sockets.
#include <iostream>
using namespace std;
class Bicycle
{
public:
Bicycle(int = 20, int = 12);
void printBicycle();
private:
int wSize;
int gears;
};
Bicycle::Bicycle(int w,int g)
{
wSize = w;
gears = g;
if (wSize >= 15 || wSize <= 35)
wSize = w;
else
wSize = 20;
if (gears >= 5 || gears <= 20)
gears = g;
else
gears = 12;
}
void Bicycle::printBicycle()
{
cout << "Bicycle Information:\n";
cout << "Wheel size: " << wSize << endl;
cout << "Number of gears: " << gears << endl;
}
int main()
{
Bicycle myBike;
myBike.Bicycle(24,17);
myBike.printBicycle();
return 0;
}