Solved

State the Underlying Type of the Following Expressions

Question 5

Essay

State the underlying type of the following expressions:
(a) let $a := 1 + 2 return $a + $a
(b) let $a := 1e0 + 1.0 return $a + $a
(c) let $a as xs:integer := 1 + 2 return $a + $a
(d) let $a as xs:decimal := 1 + 2 return $a + $a
(e) let $a as xs:double := 1 + 2 return $a + $a
(f) let $a := xs:double(1 + 2) return $a + $a
(g) let $a as xs:double := xs:double (1 + 2) return $a + $a
(h) let $a as xs:decimal := 1, $b as xs:integer := $a + $a return $b + $b
(i) if ($a < $b) then 3 else 4 (assume $a and $b are xs:integer)
(j) if ($a < $b) then "abc" else 4.00 (assume $a and $b are xs:integer)
(k) if ($a < $b) then 3.6e1 else 4 (assume $a and $b are xs:integer)
(l) (if ($a < $b) then 3.6e1 else 4) + 0.5 (assume $a and $b are xs:integer)

Correct Answer:

verifed

Verified

(a) xs:integer (1 + 2 has type xs:intege...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions