INFORMATICS 1B NEW - PR
INFORMATICS 1B NEW - PR
MODULE Informatics 1B
DURATION 3 hours
ds
Answer ALL questions.
i) int number();
ii) float average[];
iii) double[] marks;
iv) counter int[];
A) i only
B) ii and iii
C) iv
D) i and iii
1.2 What is the result of compiling and running the following code?
A) Databases
B) Objects
C) Sequential files
D) Indexed files
ds 1
1.5 What is the return type of constructors?
A) int
B) float
C) void
D) None of the above
1.6 An efficient and powerful way to store, manipulate and retrieve large amounts of data is:
A) Files
B) Records
C) Databases
D) Storage
1.7 Which one of these operators is used to allocate memory to an array variable in Java?
A) malloc
B) alloc
C) new
D) new malloc
1.8 Given the declaration Circle x = new Circle (); which of the following statements is most accurate?
1.9 Methods that are automatically executed when an object of a given type is created is referred to as:
A) Classes
B) Constructors
C) Methods
D) Constants
ds 2
1.12 Which statement below will legally declare, construct and initialise an array?
A) zero
B) one
C) determined by the array declaration
D) changed as the program runs
A) processed information
B) facts and statistics collected together for reference or analysis
C) ordered records
D) meaningful facts
1.17 A collection of data items where each item is linked to its successor is called:
A) Elements
B) Indexes
C) Linked Lists
D) Arrays
ds 3
1.18 What is the output of the following piece of code?
1.20 A linear list of elements in which deletion can be done from one end (front) and insertion can take
place only at the other end (rear) is known as a:
A) Queue
B) Stack
C) Tree
D) Linked list
ds 4
QUESTION 2 (20 Marks)
Determine if the following statements are True or False. Write down the question number and the correct
answer next to it. E.g. 2.21 True
ds 5
QUESTION 3 (20 Marks)
3.2 Implement the following stack operations into a Java program called StackTest; name the stack s1. (10 marks)
4.2 Write java code to create an array called hobbies[] that has the following elements: {swimming,
reading, hiking, soccer, fishing and dancing}. Using a loop, output all the elements of the array.
(15 marks)
5.3 List the advantages and disadvantages of temporary and permanent data. (4 marks)
5.4 Besides variables, there are numerous other ways to store information in temporary storage. List these
mechanisms. (5 marks)
END OF PAPER
ds 6