
Programming Logic and Design, Introductory 7th Edition by Joyce Farrell
النسخة 7الرقم المعياري الدولي: 1285225562
Programming Logic and Design, Introductory 7th Edition by Joyce Farrell
النسخة 7الرقم المعياري الدولي: 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
الخطوة 1 من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.
الخطوة 2 من 9
الخطوة 3 من 9
الخطوة 4 من 9
الخطوة 5 من 9
الخطوة 6 من 9
الخطوة 7 من 9
الخطوة 8 من 9
الخطوة 9 من 9
لماذا لم يعجبك هذا التمرين؟
أخرى