No pattern implementation
Kitty is on a roll! You know how it gets. She knocked out the enumerations, base class, and subclasses in nary an hour. She’s seriously cruising along and she doesn’t want to lose velocity. Kitty gives in to the temptation to write this code for the final implementation of the main entry point for the program:
using BumbleBikesLibrary; const string errorText = "You must pass in mountainbike, cruiser, recumbent, or roadbike";
We take in an argument from the command-line program and use that to determine what to make. If a string was passed in, the length of args
will be greater than zero and we can do our thing. Otherwise, we can admonish our foolish users for thinking our software can read their minds:
if(args.Length > 0) {
It’s a good idea to trim and normalize your command-line input. This means we ignore extra spaces in front of and after the argument. We ignore the case by forcing everything to either...