- A Object Oriented Programming Oop Is A Programming Paradigm Based On The Concept Of Objects Which Can Contain Dat 1 (153.68 KiB) Viewed 17 times
(a) Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain dat
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
(a) Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain dat
(a) Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code: data in the form of fields, and code, in the form of procedures. There are 4 basics of OOP concepts which are abstraction, encapsulation, inheritance, and polymorphism. (i) Explain what is the difference between encapsulation and polymorphism? C2 [SP1] (111) [2 marks] (ii) A temperature sensor is used to read a boiling tank temperature. When the reading is 100° Celsius and more, stove will turn off and valve will open to flow out the water. If the reading is below 100 Celsius, stove will turn on fire and valve will close. Write a Java program as simulation of the condition and user able to set their own value as temperature value to simulate it. C5 [SP4] [7 marks] Modify the Java program in Q2(a)(ii) to let user run random number of temperature value each time they run the simulation. Let the simulation automatically run for 5 times. C4 [SP3] [3 marks]