DOM Tutorial Monopoly Questions (Easy)

From Progzoo
Jump to navigation Jump to search

These question concern the monopoly documents. Your code is tested against three different documents and

<!DOCTYPE game SYSTEM "monopoly.dtd">
  <square label='GO'>
   <player id='dog'  cash='1500'/>
   <player id='ship' cash='1500'/>
   <player id='iron' cash='1500'/>
  <square label='Old Kent Road' ref='old-kent-road'/>
  <square label='Community Chest'/>
  <square label='Whitechapel' ref='whitechapel'/>
  <square label='Income Tax (Pay 200)'/>
  <square label="King's Cross Station" ref='kings-cross'/>
  <property id='old-kent-road' price='60'  colour='brown'/>
  <property id='whitechapel'   price='60'  colour='brown'/>
  <station  id='kings-cross'   price='200'/>

Number of child elements

Show the number of child elements.

[Font] [Default] [Show] [Resize] [History] [Profile]

Number of player elements

Print the number of player elements.

[Font] [Default] [Show] [Resize] [History] [Profile]

Square 3

Show the label of square element number 3.

[Font] [Default] [Show] [Resize] [History] [Profile]

Parent of player 1

Show the label of the parent of player number 1.

[Font] [Default] [Show] [Resize] [History] [Profile]

id of property 0

Show the id of property number 0.

[Font] [Default] [Show] [Resize] [History] [Profile]