There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply () below.
If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply () below!
Agree with a comment or answer? Like () to up-vote the contribution!
Why is the m after the number of a decimal necessary? The intro said it was to make it clear that we’re defining a decimal, but isn’t that why I’m writing decimal in front of the variable name in the first place? Oo
The lesson states that after giving a value to a decimal we need to include the letter “m” so C# knows we’re using a decimal, not a double. Why is this? Wouldn’t declaring the variable as a decimal already tell C# that it’s a decimal?
Is there any reason why the data type decimal can say decimal revenue (no capitalization need for variable) but others like int need something like variableName (capitalization needed for variable)? I hope this question makes sense. Thanks!
I believe I understand your question, and hopefully have an answer…
There is no law in the variable name that would stop the program running, it’s just a preferred policy for readability - called camelCase, the rule is the first word always starts with a lower case and the second is upper case, to differentiate two or more words. In the case of “revenue” it’s the first word so no capital needed (for example, if you wanted to call it total revenue, you’d use “totalRevenue”). As it’s not enforced, it’s entirely possible to write one of the previous variables how you want. Pizza shops could be written “PiZZaSHopS” or “PIZZA_Shops” for all C# cares).