Professional Documents
Culture Documents
MARKING SCHEME
TEST
SEMESTER I
SESSION 2021/2022
CONFIDENTIAL
CONFIDENTIAL BIT20603
For both instances, the program should then call the methods to display
the temperature in Fahrenheit, Celsius, and Kelvin.
Figure Q1
2
CONFIDENTIAL BIT20603
(a) Declare the data field for the class with appropriate access specifier.
(C4, 1 mark)
3
CONFIDENTIAL BIT20603
Q2. Answer Q2(a)-Q2(d) based on the information given in Figure Q1 and Figure Q2.
Figure Q2
(b) Write a program fragment that will ask user to enter temperature values. The
temperature values shall be used to initialize the data field for each object
referenced in tempArray (Use constructor).
(C4, 8 marks)
(c) Write a program fragment that will determine and display the maximum
temperature of the week.
(C4, 10 marks)
(d) Write a program fragment that will determine and display the average
temperature of the week.
(C4, 10 marks)
- END OF QUESTIONS –
4
CONFIDENTIAL BIT20603
MARKING SCHEME
No. Answer
5
CONFIDENTIAL BIT20603