You guys probably noticed by now that this is my third question in a row lol. Sorry about that but I decided to work on as much different problems as I can and when I get stuck I posted those online so I can wait on those while I work on other problems. Messy time management on my part haha :)
So I managed to create both the header files and the cpp files but for some reason it wont accept the arguments I'm trying to pass. I double checked my codes for hours and I can't seem to figure out why.. Thanks guys.
"error C2661: 'CruiseShip::CruiseShip' : no overloaded function takes 3 arguments"
"IntelliSense: no instance of constructor "CruiseShip::CruiseShip" matches the argument list"
#pragma
#ifndef Ship_H
#define Ship_H
#include <string>
usingnamespace std;
class Ship
{
protected:
string Name;
string Year;
public:
Ship()
{ Name = ""; Year = "";}
Ship(string N, string Y)
{ Name = N; Year = Y;}
void setN(string N)
{ Name = N;}
void setY(string Y)
{ Year = Y;}
string getN() const
{return Name; }
string getY() const
{return Year; }
void print()
{ return cout << "The name of the ship is " << Name << " and it was built on " << Year << endl;}
};
#endif Ship_H
You are never calling Print2() as far as I can see. Maybe that is what your problem is? Also, does it access the numbers themselves somewhere? Also, you aren't calling getT() either... try adding these functions to your printing statements where you do the actual printing.