@
Radar
Just a little advice that might come in handy in the future:
It's quite a good idea to always provide a
default:
case for your switch, so you can catch bad input. If your user entered
6
in your program, then your program would just end. There are compiler options that produce warnings whenever there is no
default
case in a
switch
.
I would also provide case that allows the user to quit.
You could also make the type of the
option
variable
unsigned short
. Even better use an
enum
(as you said, another way of doing it). A C++11 scoped enum allows one to put in a type. There are compiler options that produce warnings when not all the values of the
enum
are accounted for as cases in the
switch
.
With the
enum
, I would not put Ship in the name of the
enum
, just have the Colours, that one can use it for other things that have colours.
Finally, try to avoid having
using namespace std;
there is plenty written about why that is bad - Google it.
Hope all is going well at your end :+)