Would like help with the following Question 1 (5 points) In the representation o
ID: 3685756 • Letter: W
Question
Would like help with the following
Question 1 (5 points)
In the representation of floating point data types, which part of the representation controls the precision?
Question 1 options:
Both the mantissa and exponent
The mantissa
The exponent
The sign bit
Save
Question 2 (5 points)
Which of the following is not a scalar data type?
Question 2 options:
Boolean types
Record types
Integer types
Enumerated types
Save
Question 3 (5 points)
In which of the following languages, can subscripting not be used to select a single character with in a string?
Question 3 options:
Java
Ada
C++
C
Save
Question 4 (5 points)
Which of the following types is intended to be used for nonnumeric data?
Question 4 options:
Integer types
Floating point types
Decimal types
Enumerated types
Save
Question 5 (5 points)
When a two-dimensional array is stored in row major order, which of the following values is needed to compute the location of an array element?
Question 5 options:
Half the total number of elements in the array
The total number of elements in the array
The number of rows
The number of columns
Save
Question 6 (5 points)
What is the difference between a discriminated and free union?
Question 6 options:
A discriminated union has a tag or discriminant field
Free unions require greater run time error checking
The size of free unions cannot be computed at compile time
There is no difference
Save
Question 7 (5 points)
Which of the following languages has both pointers and references?
Question 7 options:
Ada
Java
C++
C
Save
Question 8 (5 points)
Consider the following code fragment in C++: int *p = new int; p = new int; What happens as a result of the above code?
Question 8 options:
Garbage is created
A dangling pointer is created
The above code will not compile
A dangling reference is created
Save
Question 9 (5 points)
When the reserved word static modifies a C++ local variable, what effect does it have?
Question 9 options:
It changes the variable's lifetime
static cannot modify local variables in C++
It changes both the scope and lifetime
It changes the variable's scope
Save
Question 10 (5 points)
Variables that are bound to a memory location throughout the life of a program are which of the following kind of variables?
Question 10 options:
Explicit heap-dynamic variables
Implicit heap-dynamic variables
Local variables allocated on the stack
Static variables
Save
Question 11 (5 points)
For a language to be able to allow recursion, what type of memory allocation must the language support?
Question 11 options:
Heap allocation
Free store allocation
Stack allocation
Static allocation
Save
Question 12 (5 points)
In Java, under what conditions can two local variables in the same method have the same name?
Question 12 options:
There are no restrictions
Provided their scopes are disjoint
Two different local variables can never have the same name
Provided they have different scopes
Save
Question 13 (5 points)
Which of the following languages is the most strongly typed?
Question 13 options:
C++
C
Java
Ada
Save
Question 14 (5 points)
The struct data type of C can best be described as which of the following kinds of types?
Question 14 options:
A record type
A pointer type
An array type
A reference type
Save
Question 15 (5 points)
When does static binding of a variable name to a memory location occur?
Question 15 options:
Not until link time
It depends on the program
At compile time
Not until run time
Save
Question 16 (5 points)
When a language provides automatic garbage collected, which of the following tasks is the programmer freed from having to do explicitly?
Question 16 options:
Deallocate heap-dynamic variables
Allocate heap-dynamic variables
Allocate stack-dynamic variables
Deallocate stack-dynamic variables
Save
Question 17 (5 points)
In Java, which of the following produces a compilation error?
Question 17 options:
Assigning a double to a float
Assigning a short to a int
Assigning an int to a long
Assigning an int to a double
Save
Question 18 (5 points)
Consider the following code fragment in C++: int *p; *p = 5; What happens as a result of the above code?
Question 18 options:
Garbage is created that can never be deallocated
Automatic garbage collection occurs
A dangling pointer is being deferenced, which could cause the program to crash
The above code will not compile
Save
Question 19 (5 points)
What term is used to describe the language feature in which the type of a variable is determined by a default convention, such as a naming convention?
Question 19 options:
Explicit declaration
Implicit declaration
Default binding
Name binding
Save
Question 20 (5 points)
Which of the following best describes the difference between a pointer and a reference?
Question 20 options:
Pointers can point to memory on the heap, references cannot
Pointers are implicitly dereferenced
References can point to memory on the heap, pointers cannot
References are implicitly dereferenced
Save
Both the mantissa and exponent
The mantissa
The exponent
The sign bit
Explanation / Answer
Q1. The mantissa
Q2. Record type
Q3. Java
Q4. Enumerated types
Q5. The number of rows
Q6. A discriminated ubion has a tag or discriminant field
Q7. C++
Q8. A dangling pointer is created
Q9. It changes the variable's liftime
Q10. Static variables
Q11. Stack allocation
Q12. Two different local variables can never have the same name
Q13. Java
Q14. A record type
Q15. At compile time
Q16. Deallocate heap-dynamic variables
Q17. Assigning a double to a float
Q18. A dangling pointer is being deferenced, which could cause the program to crash
Q19. Name binding
Q20. Refrences are implicitly dereferenced
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.