In C++, some of the following are legal identifiers. Which? Why?

a. 9xyz
b. Xyz
c. X+yz
d. xy_z
e. xyz!

a. 9xyz no – An identifier cannot start with a digit
b. Xyz yes. An identifier may have upper and lower case letters
c. X+yz no – This has an illegal ‘+’.
d. xy_z yes.
e. xyz! no – This has an illegal ‘!’.

Computer Science & Information Technology

You might also like to view...

Text that does not contain any characters and is created by typing two sets of double quotes without a space in between is called a ________

A) zero length string B) null length field C) zero length field D) null length string

Computer Science & Information Technology

Case-based Critical Thinking QuestionsCase 11-1Ryan is new to the use of XML, so he has a lot of basic questions about the fundamentals, including some philosophical questions about the language. Ryan asks how the rules for a given XML vocabulary are specified, and you explain that it is done using either a document type definition (DTD) or schema. Which of the following is NOT a true statement about DTDs and schemas?

A. Both DTDs and schemas contain rules for how data in a document vocabulary should be structured. B. A DTD defines the structure of the data and, very broadly, the types of data allowable. C. A schema more precisely defines the structure of the data and specific data restrictions. D. DTDs and schemas are required, but they are seldom helpful in ensuring that your XML documents follow a specific vocabulary.

Computer Science & Information Technology