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/c... 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
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.
Step 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 the digits 0 to 9 and the letters A to F, making a total of 16 unique symbols.
Step 3
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/variables, as an array can store multiple values while a variable can only store one.
Step 4
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 provided array because an array can only store values of one specific data type. In this case, names (strings) and ages (integers) are represented by two different data types.
Step 5
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!
Answer
To insert the value 92 at index 6 of the arrNum array, we need to shift elements starting from index 6 to the right by one position. The algorithm can be as follows:
For k from 10 down to 6 do:
arrNum[k + 1] ← arrNum[k]
EndFor
arrNum[6] ← 92
Step 6
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
(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
(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
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 returns the value of an attribute of an object, while a mutator method changes the value of an attribute of an object.
Step 10
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!