JABATAN TEKNOLOGI MAKLUMAT DAN KOMUNIKASI COURSE WORK ASSESSMENT ( DECEMBER 2013) NAME : ______________________________________ REGISTRATION NO: __________________ CODE & COURSE : FP301 OBJECT ORIENTED PROGRAMMING PROGRAM: _______________ LECTURER : AZROL HISHAM BIN MOHD ADHAM DATE:____________________ LABORATORY EXERCISE NO : 3 (CLO 2 & CLO 3) COURSE LEARNING OUTCOMES: CLO2 : Design a successful programs using concepts of Object Oriented Programming and exception handling. CLO3 : Solve problems using the Object Oriented Programming approach to produce well engineered program. Learning Outcome: By the end of this lab, student should be able to: 1. Create Java program apply basic structure class, method, variable and object. (CLO2 & CLO3) Instruction: Answer all questions. 1. The following are programming and output to display sum of two integer and sum of three integer number in overload1 class. Complete the program based on the comment stated. (CLO2 & C3) (6 Marks) Output: 10+20=30 10+20+30=60 2. Based on the above program, write a constructor method to replace tambah() method and write code on how to invoke the constructor method. (CLO2 & C3) (2 Marks) 3. The following is program that use getter and setter method. Complete the code, base on comment stated. (CLO2 & C3) (6 Marks) 4. Write a java class name KuasaDua to get an input from user using method input(). The input is an integer number. The class will output a square of the input using method output(). Then create a subclass name KuasaTiga from superclass KuasaDua. Subclass KuasaTiga will override method output() to display the cube of an input number (n3). (CLO2 & C4) (6 Marks) Di sediakan oleh: ____________________________ (AZROL HISHAM BIN MOHD ADHAM) Penyelaras Kursus FP301 Disemak oleh: _________________________________ (PUAN NURUL ZAKIAH BINTI KASNUN ) Ketua Program DIP