You are using a lot of booleans, but you don't see them.
A bool is variable that is either TRUE or FALSE, no other options.
1 2
|
bool varibleName = (shape == "cylinder" || shape == "Cylinder");
if (varibleName)
|
is equal to
|
if (shape == "cylinder" || shape == "Cylinder")
|
except for the fact that in the first option you can use the variable name in other places, while with the second one you would keep performing the same comparison over and over again.
That being said, yes if you wanted to add more criteria you would just copy the previous line and change the text that it was compared to.
Also, maybe it is easier to google for the "tolower" function. It might save you a lot of work and clean up your code quite a lot if you modify every capital from the input to a lower case letter.
In addition, then you would also be able to properly respond to input like:
RECTANGLE, ReCtAnGlE, rECTANGLE and so on.