More function examples
We didn't add any new material today;
we just practiced some more with writing functions,
including one pretty complicated example!
addTax.cpp - This is an example of using both a reference variable (double& a)
and a regular return type (bool) to essentially return two pieces of data from the same function.
This example shows off the ability to call one function from within another function.
The main goal of the program is to alphabetically sort the characters in the input string,
which is pretty tricky to code correctly!
There are lots of other fancier sorting algorithms out there which would do the job faster;
I chose this one for simplicity.
Here are some Google searches you could try if you're having trouble with today's material.
sorting algorithms -
This will quickly lead to a Wikipedia article
where you can read about lots of different algorithms if you want.
The one we used is near the top, under "Selection sort".