Computer Science, asked by porresianparrapio506, 22 days ago

write down a guidance for writing a variable​

Answers

Answered by Dnyanesshwari
0

1. Name your variables based on the terms of the subject area, so that the variable name clearly describes its purpose.

2. Create variable names by deleting spaces that separate the words. Capitalize each word in the name, including prepositions and pronouns that consist of a single letter.

Example:

Variable DirectoryProcessingDialog; // Dialog to work with a directory

Variable DirectoryProcessingDialog; // Dialog to work with a directoryVariable PacksInBoxQuantity; // Number of packs in a box

Examples of incorrect variable names:

maxAttributes, matchTypeName, newStr

3. Do not begin variable names with an underscore.

4. Do not use variable names that consist of a single character. Short variable names are only allowed for loop counters.

5. Name variables that describe binary states ("true" or "false") after the state that matches the "true" value.

Example:

Variable HasErrors; // Shows whether procedure contains errors.

Variable HasErrors; // Shows whether procedure contains errors.Variable IsReusableContainer; // Shows whether a product is a reusable container.

Answered by dhameliyadhruv8
1

Answer:

•A variable name can only have letters (both uppercase and lowercase letters), digits and underscore.

•The first letter of a variable should be either a letter or an underscore.

•There is no rule on how long a variable name (identifier) can be.

Similar questions