Knowee
Questions
Features
Study Tools

Determine which of the following are valid identifiers. If invalid, explain why.(a) r e c o r d 1 ( e ) $ t a x ( h ) name-and-address(b) l r e c o r d cr) name (i) name-and-address(c) f i l e - 3 (g) name and address (j) 123 - 45 - 6789(6) r e t u r n

Question

Determine which of the following are valid identifiers. If invalid, explain why.(a) r e c o r d 1 ( e ) $ t a x ( h ) name-and-address(b) l r e c o r d cr) name (i) name-and-address(c) f i l e - 3 (g) name and address (j) 123 - 45 - 6789(6) r e t u r n

🧐 Not the exact question you are looking for?Go ask a question

Solution

(a) r e c o r d 1: Valid identifier. It consists of alphabetic characters and a numeric digit.

(e): Invalid identifier. It consists of only a single character, which is not allowed.

$ t a x: Invalid identifier. It starts with a special character, which is not allowed.

(h): Invalid identifier. It consists of only a single character, which is not allowed.

name-and-address: Valid identifier. It consists of alphabetic characters and a hyphen.

(b) l r e c o r d cr: Invalid identifier. It contains a space, which is not allowed.

name: Valid identifier. It consists of alphabetic characters.

(i): Invalid identifier. It consists of only a single character, which is not allowed.

name-and-address: Valid identifier. It consists of alphabetic characters and a hyphen.

(c) f i l e - 3: Invalid identifier. It contains a space and a hyphen, which are not allowed.

(g): Invalid identifier. It consists of only a single character, which is not allowed.

(j) 123 - 45 - 6789: Invalid identifier. It contains spaces and hyphens, which are not allowed.

(6): Invalid identifier. It consists of only a single digit, which is not allowed.

r e t u r n: Valid identifier. It consists of alphabetic characters.

This problem has been solved

Similar Questions

Which of the following is a valid identifier in Java? a. 123identifier b. _identifier c. #identifier d. identifier-123

Assume that your version of C can recognize only the first 8 characters of an identifier name, though identifiernames may be arbitrarily long. Which of the following pairs of identifier names are considered to be identical andwhich are distinct?(a) name, names (6) l i s t l , l i s t 2( b ) address, Address ( e ) answer, ANSWER(c) i d e n t i f i e r - 1 , i d e n t i f i e r - 2 CI) c h a r l , char-1

n a PL an identifier is permitted to be a letter following by any number of letters or digits. If L and D denote the sets of letters and digits respectively, which of the following expressions defines an identifier?Question 6Answera.(LUD)+b.L(L∪D)∗c.(L.D)*d.L(L.D)*

Which of the following is an invalid identifier in C?

Which one of the following statements regarding Java identifiers is  NOT correct?Group of answer choicesJava predefined keywords cannot be used as identifiers.Can have letters, digits and underscore charters.Can be of any length.Are case sensitive.Can start with a digit.

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.