Just started learning C++ the other day just out of sheer curiosity. I have been writing this little program for about a day now (not in total :P) and I have so far accheived what i would like to, but i wish to expand on it a little more.
My program is just a simple pay calculator but I want to expand so that it will calculate the time worked. So for example the console will first off ask me if i would like to Caculate the total time worked or the Total weekly pay.
Then if i type in Total time worked it will call the function WorkTime() If i type in Pay Cal it will call the function PayCal()
I have done some research into this but the only thing i have found is to use #include <string> but i did and i don't know what to do after that lol.
That is where im confused. My code is below if you would like to have a look.
The std::string class encapsulates an array of char -- which holds the textual information you see on the computer.
When the computer asks you for a number and you type "42" for an answer -- you have given the computer a string -- a list of characters. The >> operator knows how to convert the string "42" into the number 42.
So when you ask whether the user wishes to try again, he will type a string like "yes" or "Yeah!" or "y" or "No way!" or "never again" -- and all you do is check to see if the first character in the string (which index is zero) is a 'Y' or 'y'.
That is a common word to misspell -- I used to do it all the time.