75% found this document useful (4 votes)
1K views2 pages

Hands-On Activity People in School: Objective

This document provides instructions for a hands-on activity to create a program that exhibits inheritance. Students will create classes for Person, Student, Faculty, and Employee with the given attributes and methods. The main method will prompt the user to select a type and collect the relevant input data. It will then display the output based on the object type, showing the inherited attributes from the Person class along with the specific attributes for each subclass. The activity is graded based on correctness, logic, efficiency, and syntax.

Uploaded by

DARA
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
75% found this document useful (4 votes)
1K views2 pages

Hands-On Activity People in School: Objective

This document provides instructions for a hands-on activity to create a program that exhibits inheritance. Students will create classes for Person, Student, Faculty, and Employee with the given attributes and methods. The main method will prompt the user to select a type and collect the relevant input data. It will then display the output based on the object type, showing the inherited attributes from the Person class along with the specific attributes for each subclass. The activity is graded based on correctness, logic, efficiency, and syntax.

Uploaded by

DARA
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

Hands-on Activity
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. Write a simple information system that will store and display the complete information of a student,
faculty, or employee.
2. Create four (4) no-modifier classes named Person, Student, Faculty, and Employee.
3. Create a public class named CollegeList. This class shall contain the main method.
4. Refer to the UML Class Diagram for the names of the variables and methods. The (-) symbol
represents private variables, while (+) represents public method. 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). Then, 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). Then, 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 Hands-on Activity 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 Hands-on Activity 1 *Property of STI


Page 2 of 2

You might also like