
Programming Logic and Design, Introductory 7th Edition by Joyce Farrell
Edition 7ISBN: 1285225562
Programming Logic and Design, Introductory 7th Edition by Joyce Farrell
Edition 7ISBN: 1285225562Explain why each of the following names does or does not seem like a good variable name to you.
a. d
b. dsctamt
c. discountAmount
d. discount Amount
e. discount
f. discountAmountForEachNewCustomer
g. discountYear2013
h. 2013Discountyear
Step 1 of 9
Naming variables:
Declaration is a statement which contains the “data type” and “identifier for variable”.
• Data type can hold the value for variable.
• Identifier is a name of the component.
The declaring the variable name must be follows only three rules such as,
• Variable name must be a single word.
o The name contains the letters, digits, hyphens, underscores, or any other characters without any space.
o Example: “a”, “alpha”, and “isAlpha”. But, “is Alpha” is not a valid variable name.
• Variable name must begin with letter.
o It only allows the starting letter of variable name must be letter.
• Variable name must be short, descriptive, and suitable meaning.
Step 2 of 9
Step 3 of 9
Step 4 of 9
Step 5 of 9
Step 6 of 9
Step 7 of 9
Step 8 of 9
Step 9 of 9
Why don’t you like this exercise?
Other