Laboratory Task 3 (Q) DFP30243 SESI I 2022 2023

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

POLYTECHNIC SULTAN MIZAN ZAINAL ABIDIN

DEPARTMENT OF INFORMATION AND COMMUNICATION TECHNOLOGY

DFP30243
OBJECT ORIENTED PROGRAMMING

TOPIC CHAPTER 4

ASSESMENT LABORATORY TASK 3

NAME MUHAMMAD ZAKWAN HAKIMI BIN ZAHARI

REG NO 13DDT21F1122

PROGRAMME DDT3-S4

INSTRUCTIONS :

1. Answer ALL the questions


2. Submit the assessment on

MARKING SCHEME
CLO 1 PLO 3 / 20

TOTAL / 20
THE ENTIRE QUESTION IS BASED ON JTMK’S QUESTION BANK APPROVED BY PROGRAMME LEADER.
SIGNATURE IS NOT REQUIRED.

CHAPTER 4 : INHERITANCE AND POLYMORPHISM

Learning outcomes:

By the end of this lab, students should be able to:

 Implement concept of inheritance in Java Program.


 Implement method overriding in Java Program.
 Implement abstract classes.

Question

1. Build an abstract class that contains the following item:


i. declare a constant data members, name as password type of integer with value 111.
ii. declare a protected data members, type of String.
iii. declare a default constructor to print "LOGIN FORM" as output.
iv. define a method to print "Your Username must be your name or nickname " as
output.
v. declare an abstract method login.

2. Build another class to inherit an abstract class that contains the following item:
i. Declare BufferedReader object.
ii. Define a method to input username.
iii. override abstract method that can print username and password as output.
iv. Define main method to create an object from subclass and use that object to execute
3 methods (Question 1(iv), 2(ii) and 2(iii))

3. Save and compile the program.


DFP30243 OBJECT ORIENTED PROGRAMMING

RUBRIC LABORATORY TASK 3

STANDARD WEIGHTAGE SCORE


CRITERIA Superior Excellent Good Poor
MARK (w) ((s/4) x
4 3 2 1 (s) w)
Code is organized, Code is organized, 3
Code is well Code is
almost complete contain one
organized, well disorganized, no
Coding Standard comments, comments,
written comments, comments, no
inconsistent inconsistent
proper indentation. indentation.
indentation. indentation.
The program uses The program uses 6
The program uses The program uses
Program Technique incomplete incomplete
complete incomplete
- inheritance inheritance with inheritance with
inheritance. inheritance.
minor error. major error.
7
The program uses The program uses
The program uses The program uses
Program Technique incomplete method incomplete method
complete method incomplete method
- method overriding overriding and overriding and
overriding and overriding and
- abstract class abstract class with abstract class with
abstract class. abstract class.
minor error. major error.

Executes without Executes without Executes with some Does not execute
errors and the errors and the errors and the due to errors and
Execution and Output 4
program produces a program produces program does not the program does
correct output incorrect output produces output not produces output
TOTAL (20)

You might also like