A few sections ago, I said that you can make up any name you want for your variables, but thatβs not quite true. There are certain words that are reserved in C++ because they are used by the compiler to parse the structure of your program, and if you use them as variable names, it will get confused. These words, called keywords, include int, char, void, endl and many more.
Rather than memorize the list, I would suggest that you take advantage of a feature provided in many development environments: code highlighting. As you type, different parts of your program should appear in different colors. For example, keywords might be blue, strings red, and other code black.
Case matters! You can name a string variable String without an issue because C++ does not consider String to be the same as keyword string. Also, a anything written in quotes, for example "string" is not considered a keyword in C++, even if it is spelt the same.
Fix the code below so that it runs without errors and produces the intended output. Hint: you might need to change the names of some variables so they do not conflict with C++ keywords.