QUESTION 3 (a) Classes are used to group a few related, named, data values associated with an entity. It is typically a
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
QUESTION 3 (a) Classes are used to group a few related, named, data values associated with an entity. It is typically a
QUESTION 3 (a) Classes are used to group a few related, named, data values associated with an entity. It is typically a noun referring to a problem. A method is a block of code which only runs when it is called. (i) (ii) Explain why do programmers want to make various classes as opposed to putting everything into different methods in the one class that contains the main method? C2 [SP1] [2 marks] 11 21 31 41 Customize Table 1 2 3 7 12 17 19 4696 14 2 22 24 11 2222 1616 16 112N 4 13 ليا 0 لا - 18 21 23 26 28 Figure Q3(a)(ii): Customize Table Write a Java program which can generate the Customize Table in Figure Q3(a)(ii) by using Nested For Loop. C5 [SP4] [7 marks] (iii) Is it possible to modify Java program in Q3(a)(ii) to use if-else statement? If yes, modify the coding accordingly. If no, write your explanation and suggestion. C6 [SP3] [3 marks]