5.1 Binary and hexadecimal systems are two number systems used in computing - NSC Information Technology - Question 5 - 2022 - Paper 2
Question 5
5.1 Binary and hexadecimal systems are two number systems used in computing.
5.1.1 What is the base number of the binary number system?
5.1.2 Give ALL the digits/... show full transcript
Worked Solution & Example Answer:5.1 Binary and hexadecimal systems are two number systems used in computing - NSC Information Technology - Question 5 - 2022 - Paper 2
Step 1
5.1.1 What is the base number of the binary number system?
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The base number of the binary number system is 2. This indicates that it only uses two digits, which are 0 and 1.
Step 2
5.1.2 Give ALL the digits/characters that the hexadecimal number system consists of.
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The hexadecimal number system consists of 16 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F.
Step 3
5.2.1 When does it become necessary to use an array instead of a variable?
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
It becomes necessary to use an array instead of a variable when working with a large number of values or when multiple values of the same type need to be stored. An array can hold multiple values, while a variable can store only a single value.
Step 4
5.2.2 Motivate why the names and ages cannot be stored in the array provided.
98%
120 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The names and ages cannot be stored in the array because an array can only store values of one specific data type. Names are strings, while ages are integer values, which differ in data types.
Step 5
5.2.3 Write an algorithm using a loop to insert an additional value of 92 at index position 6 in the arrNum array.
97%
117 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
For k from 10 down to 6:
a. Set arrNum[k + 1] = arrNum[k]
Set arrNum[6] = 92
The contents of the array after execution will be [46, 82, 23, 54, 92, 12, 36, 41, 7, 3].
Step 6
5.3.1 State whether the following statements are TRUE or FALSE: (a) A toString method is used to change the value of an attribute to a string for display purposes.
97%
121 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
(a) FALSE
Step 7
5.3.1 State whether the following statements are TRUE or FALSE: (b) It is possible to instantiate an object without writing/creating your own constructor method for the object class.
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
(b) TRUE
Step 8
5.3.1 State whether the following statements are TRUE or FALSE: (c) The number of parameters received in a constructor must be equal to the number of attributes of the object class.
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
(c) FALSE
Step 9
5.3.2 Differentiate between an accessor method and a mutator method.
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
An accessor method retrieves the value of an attribute of an object without modifying it, while a mutator method changes the value of an attribute of an object.
Step 10
5.4 Draw the trace table below in the ANSWER BOOK. Complete the trace table for the code provided above if the value of 4 is entered for Number.
98%
120 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Number: 4
Factor: 0
Loop: 2
Number mod Loop: 0
Factor: 1
Output: '4 is NOT a prime number'.