Programming Concepts

Check your understanding - Variables

A variable is a named area of memory containing data that can be used in the program. Which of the following would be the best choice for a variable containing data about a person's name?

pn

Short, cryptic names do not help with the maintenance of a program. When you, or someone else, revisits the program, it may not be clear what data the variable is used for.
No. You cannot have spaces in the names of variables.
Close, but there is a better answer.
No. You should not use special characters in a variable name.
Yes, not only does the name describe the data, but the prefix indicates the type of data. Here str probably means 'String', but different programming languages will use different data types.
← Previous 1 2 3 4 5 6 7 8 9 10 11 12 Next →