C/C++ Programming and XML Schema Quiz

Mixed quiz covering C/C++ programming concepts and XML Schema specifications. Note: This quiz should ideally be split into two separate focused quizzes.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

With an extensible Schema definition you cannot:

  1. Reuse your Schema in other Schemas
  2. Create your own data types derived from the standard types
  3. Reference multiple schemas in the same document
  4. All the above
Question 2 Multiple Choice (Single Answer)

XML Schema became a W3C Recommendation

  1. 02. May 2001
  2. 03. May 2001
  3. 02. May 2000
  4. 02. May 2002
Question 3 Multiple Choice (Single Answer)

A simple element is an XML element that can contain only

  1. IMAGE
  2. NUMBER
  3. TEXT
  4. ALL OF THE ABOVE
Question 4 Multiple Choice (Single Answer)

The syntax for defining an attribute is

  1. <xs:attribute name="xxx" />
  2. <xs:attribute name="xxx" type="yyy"/>
  3. <attribute name="xxx" type="yyy"/>
  4. <xs:attribute name=xxx type=yyy/>
Question 5 Multiple Choice (Single Answer)

Restrictions on XML elements are called

  1. cards
  2. decks
  3. facets
  4. faces
Question 6 Multiple Choice (Single Answer)

How many indicators are present in Schema ?

  1. 5
  2. 6
  3. 7
  4. 8
Question 7 Multiple Choice (Single Answer)

One of the greatest strength of XML Schemas is the support for

  1. data types
  2. images
  3. graphics
  4. functions
Question 8 Multiple Choice (Single Answer)

With XML Schemas, the sender can ________ the data in a way that the receiver will understand.

  1. describes
  2. develops
  3. designs
  4. inform
Question 9 Multiple Choice (Single Answer)

Which of these are not a kind of complex elements

  1. empty elements
  2. elements that contain only other elements
  3. elements that contain only text
  4. elements that contain only numbers
Question 10 Multiple Choice (Single Answer)

A default value is automatically assigned to the attributes when no other value is specified.

  1. FALSE
  2. TRUE
  3. NOT ALWAYS
  4. NONE OF THESE
Question 11 Multiple Choice (Single Answer)

Evaluate: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7);

  1. 10
  2. 11
  3. 1
  4. 0
Question 12 Multiple Choice (Single Answer)

What does the following code do: int c=0; cout<<c++<<c;

  1. Undefined
  2. 01
  3. 00
  4. 10
Question 13 Multiple Choice (Single Answer)

What does the following do: void afunction(int *x) { x=new int; *x=12; } int main() { int v=10; afunction(&v); cout<<v; }

  1. Outputs 12
  2. Outputs 10
  3. Outputs the address of v
  4. Undefined
Question 14 Multiple Choice (Single Answer)

What is the outcome of cout<<abs(-16.5);

  1. 16
  2. 17
  3. 16.5
  4. Undefined
Question 15 True/False

Can we have a virtual constructor for a class?

  1. True
  2. False
Question 16 Multiple Choice (Single Answer)

What is the functional difference between myObj *x = new myObj[100]; delete x; and myObj *x = new myObj[100]; delete [] x;

  1. There is none; they both work as expected
  2. They both do nothing.
  3. The first will not invoke all myObj destructors
  4. It would'nt delete all the memory allocated to the objects
Question 17 Multiple Choice (Single Answer)

Which of the following gives the memory address of a pointer a?

  1. a
  2. *a
  3. &a
  4. address(a)
Question 18 Multiple Choice (Single Answer)

Which of the following reads in a string named x with one hundred characters?

  1. cin.getline(x, 100, '\n');
  2. cin.getline(100, x, '\n');
  3. readline(x, 100, '\n');
  4. read(x);
Question 19 Multiple Choice (Single Answer)

What does the argument count variable store which is paased to main()?

  1. the number of arguments
  2. the number of arguments plus one
  3. the number of arguments minus one
  4. The total size of the argument array
Question 20 Multiple Choice (Single Answer)

Which header file do you need to include to use typecasting?

  1. stdin.h
  2. ctype.h
  3. math.h
  4. None