review question:
1. What is descriptor?
Descriptor is a collection of the attributes of a variable that space in a memory what stores the attribute
2. What is the advantages and disadvantages of decimal data types?
Advantages: can store the decimal value of a number.
Disadvantages: range of value are restricted because no exponent are allowed.
4. Describe the three string length option
Ordinal: one in which the range of possible value can be easily associated with the set of positive integers.
Enumeration: one in which all of the positive values, which are name constant, are provided or enumerated in the definition.
Sub range type: a contiguous subsequence of an ordinal type.
6. What are the advantages of user-defined enumeration types?
Readability is enhanced very directly and named values are easily recognized, whereas coded values are not. In reliability this enumeration types provide two other advantages 1) No arithmetic operations are legal on enumeration types 2) No enumeration variable can be assigned a value outside its defined range.
12. What languages support negative subscripts?
Ruby and Lua support negative subscripts.
17. Define row major order and column major order.
Row major order: the elements of the array that have as their first subscript the lower bound value of the subscript are store first, followed by the elements of the second value of the first subscript, and so forth.
Column major order: the elements of the array that have as their last subscript the lower bound value bound value of the subscript are store first, , followed by the elements of the second value of the first subscript, and so forth.
22. Define fully qualified and elliptical references to fields in records.
Fully qualified reference makes all intermediate record names, from the largest enclosing record to the specific field, are named in the reference. While in elliptical references, the field is named, but any or all of the enclosing record names can be omitted, as long as the resulting reference is unambiguous in the referencing environment.
31. Define union, free union and discriminated union.
A union is a type whose variables may store different type values at different times during program execution. Free unions are union constructs in which there is no language support for type checking. Discriminated union is union with discriminant where as discriminant is an indicator required in each union construct.
43. What is a compatible type?
A compatible type is one that either is legal for the operator or is allowed under language rules to be implicitly converted by compiler-generated code to a legal type.
44. Define type error.
Type error is an application of an operator to an operand of an inappropriate type.
45. Define strongly typed.
Strongly typed is a method when the type error are always detected.
problem set:
1. What are the arguments for and against four signed integer sized in Java?
Bytes =1 byte, short = 2 bytes, integer = 4 bytes, long = 8 bytes. As a result, depending on the domain of the variable required, data types are used.
2. How are negative integers stored in memory?