KEMBAR78
Java | PDF | Constructor (Object Oriented Programming) | Programming
0% found this document useful (0 votes)
3 views26 pages

Java

Uploaded by

layasanjayan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views26 pages

Java

Uploaded by

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

ANANDHAKRISHNAN SANJAYAN

JAVA
PROJECT
01
Introduction
Overview
A Terminal based java
program,that will register
different types employees of a
company and display the stored
according to the users need.
CONCEPTS USED
#ENCAPSULATION
#ABSTRACTION
#INHERITANCE
#POLYMORPHISM
02
CLASS
CONSTRUCTOR
METHOD
● Import all the modules that we
are using in the
code(Scanner,Arraylist)

● Initialize the abstract class


employees with basic details
that are gonna be common
among all the employees

● Initializing the constructor for


the employees class
● Initialize the cal_income
method to calculate income
based on the employee type

● Intializing getter method for


all the private declared
variables first name ,last
name etc

● Initializing the tostring method


to print info contained in the
employee class
Full_time _employee class
● Initialize class full time
employee extending
employee by adding weekly
salary

● Initializing the constructor for


the full time employe class
● Overriding Cal_income
method to return weekly
salary

● Overriding the toString


method to print details of full
time employee class by using
super keyword,also weekly
and monthly salary of full time
employee
Part_time _emp class
● Initialize class part time
employee extending employee
by adding hours_working
&hourly_rate

● Initializing the constructor for


the part time employee class
● Overriding Cal_income method
to calculate weekly salary based
on working hours and hourly
rate

● Overriding the toString method


to print details of employee
class by using super
keyword,also
hours_working,hourly_rate,week-
ly salary
● Initialize class commission
employee by extending commission_emp class
employee class by adding
number of sales,commision
percentage,price of each sale

● Initializing the constructor for


the commission employee class
● Overriding Cal_income method
to calculate weekly salary based
on number of sales,commision
percentage,price of each sale

● Overriding the toString method


to print details of employee
class by using super
keyword,also on number of
sales,commision
percentage,price of each
sale ,weekly salary
● Initialize class commission
employee by extending Base commission_emp class
commission_emp class by
adding base salary

● Initializing the constructor for


the base commission employee
class
● Overriding Cal_income method
to calculate weekly salary based
on number of sales,commision
percentage,price of each sale
and adding base salary on top of
it

● Overriding the toString method


to print details of commission
emp class by using super
keyword,also base salary
03
EXECUTION
● Up on execution of
the program
An object of the
main class
company_emp is
created with that
the method
main_menu is
called
TERMINA CODE
L
TERMINA CODE
L

Method reg_emp gets


called upon choosing
operation 1
Reg_emp method
TERMINA CODE
L
TERMINA CODE
L
TERMINA CODE
L
TERMINA CODE
L
TERMINA CODE
L
TERMINA CODE
L

Print_emp_data
method gets
called
TERMINA CODE
L

Prints the relevant


tostring method
according to the
classed
TERMINA CODE
L

Prints the first name ,last


name and pos variable
TERMINA CODE
L
TERMINA CODE
L

Return statement
here closes the
whole program.
TERMINA CODE
L
THANK
YOU

You might also like