Informatics 1B Final OSA
Informatics 1B Final OSA
Data types are used to define or classify the type of values a variable can store in it. Moreover, it also describes the
possible operations allowed on those values. For example, the integer data type can store an integer value. Possible
operations on an integer include addition, subtraction, multiplication, division, and modulus.
Abstract data type (ADT) is a concept or model of a data type. Because of ADT, a user does not have to bother about how
that data type has been implemented. Moreover, ADT also takes care of the implementation of the functions on a data
type. Here, the user will have predefined functions on each data type ready to use for any operation. Generally, in ADT, a
user knows what to do without disclosing how to do it. These models are defined in terms of their data items and
associated operations.
Source: https://www.baeldung.com/cs/adt
Important note: Include a screenshot of the output for each program. Submit your screenshots on a
Word document under the file upload option on MANCOSA Connect. Ensure that each question is
clearly labelled.
3.2 Write a complete Java program called Print that includes a String array called StarSigns [ ]. The array (10 Marks)
StarSigns [ ] must store the following words (“Aries”, “Pisces”, “Leo”, “Taurus”, “Capricorn”) and this should
be output using a loop structure.
QUESTION 4 (20 Marks)
4.1 Write a Java program called Stack_Q4 for the following Stack pseudocode and show the output for the (10 Marks)
remaining elements in the Stack.:
Plan:
1. Create stack S1
2. Add the element “This is the main OSA” to the stack
3. Add the element “for the module” to the stack
4. Add the element “Informatics 1B” to the stack
5. Print S1
6. Remove the last item in the stack
7. Print S1
4.2 Convert the program in Q4.1 to a Queue. The class name should be Queue_Q4 and the reference (10 Marks)
variable for the queue structure is Q1.
END OF PAPER