50% found this document useful (2 votes)
1K views2 pages

06 Laboratory Exercise 1 - Inheritance

This document provides instructions for a laboratory exercise to create a program that exhibits inheritance. The program should store and display information about students, faculty, and employees by creating classes that inherit from an abstract Person class. The user is prompted to select a type and input relevant details, like name, contact number, salary, department, program, or year level. The classes are Person, Student, Faculty, and Employee with defined attributes and methods. Sample output is displayed and a grading rubric outlines criteria for correctness, logic, efficiency, and syntax.

Uploaded by

21penmanships
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
1K views2 pages

06 Laboratory Exercise 1 - Inheritance

This document provides instructions for a laboratory exercise to create a program that exhibits inheritance. The program should store and display information about students, faculty, and employees by creating classes that inherit from an abstract Person class. The user is prompted to select a type and input relevant details, like name, contact number, salary, department, program, or year level. The classes are Person, Student, Faculty, and Employee with defined attributes and methods. Sample output is displayed and a grading rubric outlines criteria for correctness, logic, efficiency, and syntax.

Uploaded by

21penmanships
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

IT1908

Laboratory Exercise
People in School
Objective:

At the end of the activity, the students should be able to:


▪ Create a program that exhibits inheritance.

Software Requirements:
▪ Latest version of NetBeans IDE
▪ Java Development Kit (JDK) 8

Procedure:
1. Create a folder named LastName_FirstName in your local drive. (ex. Reyes_Mark)
2. Create a new project named LabExer6. Set the project location to your own folder. The main class
should be named CollegeList. This class shall contain the main method.
3. Add four (4) Java classes named Person, Student, Faculty, and Employee.
4. Write a simple information system that will store and display the complete information of a student,
faculty, or employee. Refer to the UML Class Diagram for the names of the variables and methods.
This should be the sequence of the program upon execution:
a. Prompt the user to select among Employee, Faculty, or Student, by pressing E, F, or S.
b. Ask the user to type the name and contact number.
c. For Employee, ask the user to type the employee's monthly salary and the department where
he/she belongs to (Ex. Registrar). Afterwards, display name, contact number, salary, and
department.
For Faculty, ask the user to press Y if the faculty member is regular/tenured or N if not. Then,
display name, contact number, salary, department, and status.
For Student, ask the user to type the student's enrolled program (Ex. BSIT, BSTM) and
his/her year level (integers 1 to 4). Afterwards, display name, contact number, program, and
year level.
Person
- name: String
- contactNum: String
+ setName(String n): void
+ getName(): String
+ setContactNum(String c): void
+ getContactNum(): String

Employee Student
- salary: double - program: String
- department: String - yearLevel: int
+ setSalary(double s): void + setProgram(String p): void
+ getSalary(): double + getProgram(): String
+ setDepartment(String d): void + setYearLevel(String y): void
+ getDepartment(): String + getYearLevel(): int

Faculty
- status: boolean
+ isRegular(): boolean

06 Laboratory Exercise 1 *Property of STI


Page 1 of 2
IT1908

Sample Output:

GRADING RUBRIC (100 points):

Criterion Description Max Points


Correctness The code produces the expected result. 40
Logic The code meets the specifications of the problem. 40
Efficiency The code is concise without sacrificing correctness and logic. 10
Syntax The code adheres to the rules of the programming language. 10

06 Laboratory Exercise 1 *Property of STI


Page 2 of 2

You might also like