SlideShare a Scribd company logo
Functions
Programming concept | Example oriented explanation
Prerequisites: Basic knowledge of C, C++ or any programming language
Mr. Ajay and his business problem
Mr. Ajay, a brand-new
entrepreneur own a car-
rental business
He is the only person who manage
his business.
He is like a MAIN() FUNCTION of a
C or C++ program. Every task that
happens in his business is done by
him. Currently, nobody is helping
him to work.
After some weeks, Mr. Ajay is facing
traumatic situations. He is not able
to do all the tasks at a time as a
single human and now there are
some errors occurring because of
him.
He has been recommended by a
business consultant TO DIVIDE HIS
WHOLE TASK IN SMALL SET OF
SUBTASK, hire an employee that
can do it better, and assign him that
task.
Mr. Ajay divided his business tasks
Now, Mr. Ajay got
the point of
business and he
divided his work in
following way
RENT RECORD KEEPING
1. Get the details of car which
was ordered for rent
2. Enter and save details of car
and details of tenant in Excel
sheet
3. Complete the payment
4. Print the payment
5. Give a copy of receipt to
mechanic
6. Report it to manager
MECHANIC
1. Receive the car details from
record keeping
2. Pick up the car from car park
3. Drive the car to the tenant's
house
4. Give the copy of receipt to
tenant
5. Return to the work back
CAR CLEANER
1. Check the dirty cars in car park
2. Collect the required tools from
cleaning wardrobe
3. Clean dirty cards thoroughly
4. Put the tools back to their place
PAYROLL MANAGER
1. Check the current month
2. Pick up each employee
from the list
3. For each employee,
calculate their monthly
payment amount
4. Send the amount to the
specified employee's bank
account
5. Keep record of payment
6. Return payment reports to
manager
MANAGER MR. AJAY HIMSELF
1. While the working hours are on:
2. Collect car rent details
3. Save it in excel sheet
4. Ask the car cleaner to clean cars
if more than 10 cars are dirty
5. If this is month end, ask payroll
manager for payment reports
6. At end of the day, calculate the
business profit
7. Save those details
8. Exit from office
Mr. Ajay is free from traumatic situations
Now, the Mr. Ajay is free from trauma
of work because he must only keep
track of specific tasks and all other
tasks are divided into subtasks and
assigned to each employee.
Now, Mr. Ajay's business is touching the heights
because he learnt great management skills, but he
didn't know it was like
USING FUNCTIONS IN PROGRAMMING.
Did you find anything regarding the types of functions? Let’s see a summary
In his business, every FUNCTION (employee)
works when HE CALLS THE FUNCTIONS to do
that work.
How were the idea of functions used?
THE RECORD KEEPING
is like Function with parameter and
return value as he accept an order
from tenant and returns the receipt to
the mechanic to send the car to
tenant's house.
Types of functions
A function refers to dividing a large task into pieces of code. A function take parameters and can return values optionally.
THE MECHANIC
is like Function with parameter and
no return value because he accepts
the receipt from record keeping but
doesn't return anything to record
keeping; only drop the car to target
tenant.
Function with parameter,
and return value
Function with parameter,
but no return value
Function with no
parameter, but return
value
Function with no
parameter, no return
value
CAR CLEANER
is like Function with no parameter, no
return value as once he is called to clean
cars, he automatically does his work and
no need to tell or return anything to his
caller
THE PAYROLL MANAGER
is like Function with no parameter
but return value as he only was called
to get reports of payment. Rest of
payment task he does on himself and
returns the payment reports to the
manager Mr. Ajay.
MR. AJAY THE MANAGER is like still a MAIN FUNCTION as he keeps track of people of his business for a day. He also check for certain
conditions like necessity for cleaning car and completing payment every month.
HENCE, THIS IS WHAT A FUNCTION IS AND ITS TYPES IN PROGRAMMING

More Related Content

Similar to Functions in Programming with example

Resume Hussain Mirza
Resume Hussain MirzaResume Hussain Mirza
Resume Hussain MirzaHussain Mirza
 
12 my industry experience & colleagues
12 my industry experience & colleagues12 my industry experience & colleagues
12 my industry experience & colleagues
spandane
 
Bcom bba nmims june 2021 solved assignment
Bcom bba nmims june 2021 solved assignment Bcom bba nmims june 2021 solved assignment
Bcom bba nmims june 2021 solved assignment
rachitvishnoi1
 
MechanicBaba PitchDeck
MechanicBaba PitchDeckMechanicBaba PitchDeck
MechanicBaba PitchDeck
Ambuj Sharma
 
Virtual office admin
Virtual office adminVirtual office admin
Virtual office admin
Ketki Dandekar
 
Learning area 5 programming
Learning area 5   programmingLearning area 5   programming
Learning area 5 programming
Shuren Lew
 
Resume - CA - Dillip Kumar Sahoo having post qualification experience 17 year +
Resume - CA - Dillip Kumar Sahoo having post qualification experience 17 year +Resume - CA - Dillip Kumar Sahoo having post qualification experience 17 year +
Resume - CA - Dillip Kumar Sahoo having post qualification experience 17 year +Dillip Sahoo
 
WhoCanFixMyCar.com - tips from our top performers
WhoCanFixMyCar.com - tips from our top performersWhoCanFixMyCar.com - tips from our top performers
WhoCanFixMyCar.com - tips from our top performers
Alex Rose
 
Principles of Business (POB) SBA
Principles of Business (POB) SBAPrinciples of Business (POB) SBA
Principles of Business (POB) SBA
Christina Sookdeo
 
Management Application (Google Forms) Training (1)
Management Application (Google Forms) Training (1)Management Application (Google Forms) Training (1)
Management Application (Google Forms) Training (1)Nicole Massie
 
CV-subodh Final 18th Oct 2016
CV-subodh Final 18th Oct 2016CV-subodh Final 18th Oct 2016
CV-subodh Final 18th Oct 2016subodh sadvilkar
 
Todo
TodoTodo
performance appraisal form of singer
performance appraisal form of singerperformance appraisal form of singer
performance appraisal form of singer
Shohanuzzaman somudro
 
Business plan english version
Business plan   english versionBusiness plan   english version
Business plan english version
najihah yusof
 

Similar to Functions in Programming with example (20)

Resume Hussain Mirza
Resume Hussain MirzaResume Hussain Mirza
Resume Hussain Mirza
 
12 my industry experience & colleagues
12 my industry experience & colleagues12 my industry experience & colleagues
12 my industry experience & colleagues
 
Bcom bba nmims june 2021 solved assignment
Bcom bba nmims june 2021 solved assignment Bcom bba nmims june 2021 solved assignment
Bcom bba nmims june 2021 solved assignment
 
Dealer Presentation
Dealer PresentationDealer Presentation
Dealer Presentation
 
MechanicBaba PitchDeck
MechanicBaba PitchDeckMechanicBaba PitchDeck
MechanicBaba PitchDeck
 
Virtual office admin
Virtual office adminVirtual office admin
Virtual office admin
 
Learning area 5 programming
Learning area 5   programmingLearning area 5   programming
Learning area 5 programming
 
Sanjay Patil 23
Sanjay Patil 23Sanjay Patil 23
Sanjay Patil 23
 
Resume - CA - Dillip Kumar Sahoo having post qualification experience 17 year +
Resume - CA - Dillip Kumar Sahoo having post qualification experience 17 year +Resume - CA - Dillip Kumar Sahoo having post qualification experience 17 year +
Resume - CA - Dillip Kumar Sahoo having post qualification experience 17 year +
 
WhoCanFixMyCar.com - tips from our top performers
WhoCanFixMyCar.com - tips from our top performersWhoCanFixMyCar.com - tips from our top performers
WhoCanFixMyCar.com - tips from our top performers
 
Resume..
Resume..Resume..
Resume..
 
abhijit
abhijitabhijit
abhijit
 
mod2
mod2mod2
mod2
 
Principles of Business (POB) SBA
Principles of Business (POB) SBAPrinciples of Business (POB) SBA
Principles of Business (POB) SBA
 
Management Application (Google Forms) Training (1)
Management Application (Google Forms) Training (1)Management Application (Google Forms) Training (1)
Management Application (Google Forms) Training (1)
 
CV-subodh Final 18th Oct 2016
CV-subodh Final 18th Oct 2016CV-subodh Final 18th Oct 2016
CV-subodh Final 18th Oct 2016
 
Todo
TodoTodo
Todo
 
performance appraisal form of singer
performance appraisal form of singerperformance appraisal form of singer
performance appraisal form of singer
 
Main
MainMain
Main
 
Business plan english version
Business plan   english versionBusiness plan   english version
Business plan english version
 

Recently uploaded

The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 

Recently uploaded (20)

The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 

Functions in Programming with example

  • 1. Functions Programming concept | Example oriented explanation Prerequisites: Basic knowledge of C, C++ or any programming language
  • 2. Mr. Ajay and his business problem Mr. Ajay, a brand-new entrepreneur own a car- rental business He is the only person who manage his business. He is like a MAIN() FUNCTION of a C or C++ program. Every task that happens in his business is done by him. Currently, nobody is helping him to work. After some weeks, Mr. Ajay is facing traumatic situations. He is not able to do all the tasks at a time as a single human and now there are some errors occurring because of him. He has been recommended by a business consultant TO DIVIDE HIS WHOLE TASK IN SMALL SET OF SUBTASK, hire an employee that can do it better, and assign him that task.
  • 3. Mr. Ajay divided his business tasks Now, Mr. Ajay got the point of business and he divided his work in following way RENT RECORD KEEPING 1. Get the details of car which was ordered for rent 2. Enter and save details of car and details of tenant in Excel sheet 3. Complete the payment 4. Print the payment 5. Give a copy of receipt to mechanic 6. Report it to manager MECHANIC 1. Receive the car details from record keeping 2. Pick up the car from car park 3. Drive the car to the tenant's house 4. Give the copy of receipt to tenant 5. Return to the work back CAR CLEANER 1. Check the dirty cars in car park 2. Collect the required tools from cleaning wardrobe 3. Clean dirty cards thoroughly 4. Put the tools back to their place PAYROLL MANAGER 1. Check the current month 2. Pick up each employee from the list 3. For each employee, calculate their monthly payment amount 4. Send the amount to the specified employee's bank account 5. Keep record of payment 6. Return payment reports to manager MANAGER MR. AJAY HIMSELF 1. While the working hours are on: 2. Collect car rent details 3. Save it in excel sheet 4. Ask the car cleaner to clean cars if more than 10 cars are dirty 5. If this is month end, ask payroll manager for payment reports 6. At end of the day, calculate the business profit 7. Save those details 8. Exit from office
  • 4. Mr. Ajay is free from traumatic situations Now, the Mr. Ajay is free from trauma of work because he must only keep track of specific tasks and all other tasks are divided into subtasks and assigned to each employee. Now, Mr. Ajay's business is touching the heights because he learnt great management skills, but he didn't know it was like USING FUNCTIONS IN PROGRAMMING. Did you find anything regarding the types of functions? Let’s see a summary In his business, every FUNCTION (employee) works when HE CALLS THE FUNCTIONS to do that work.
  • 5. How were the idea of functions used? THE RECORD KEEPING is like Function with parameter and return value as he accept an order from tenant and returns the receipt to the mechanic to send the car to tenant's house. Types of functions A function refers to dividing a large task into pieces of code. A function take parameters and can return values optionally. THE MECHANIC is like Function with parameter and no return value because he accepts the receipt from record keeping but doesn't return anything to record keeping; only drop the car to target tenant. Function with parameter, and return value Function with parameter, but no return value Function with no parameter, but return value Function with no parameter, no return value CAR CLEANER is like Function with no parameter, no return value as once he is called to clean cars, he automatically does his work and no need to tell or return anything to his caller THE PAYROLL MANAGER is like Function with no parameter but return value as he only was called to get reports of payment. Rest of payment task he does on himself and returns the payment reports to the manager Mr. Ajay. MR. AJAY THE MANAGER is like still a MAIN FUNCTION as he keeps track of people of his business for a day. He also check for certain conditions like necessity for cleaning car and completing payment every month. HENCE, THIS IS WHAT A FUNCTION IS AND ITS TYPES IN PROGRAMMING

Editor's Notes

  1. Mr. Ajay owns a car rental business. He is the only person who manage his business. He is like a main() function of a C or C++ program. Every task that happens in his business is done by him. After some weeks, Mr. Ajay is facing traumatic situations. He is not able to do all the tasks at a time as a single human and now there are some errors occuring becuase of him. As a result, he is facing loss in his own performance and in business revenue. He has been recommended by a business consultant to divide his whole task in small set of subtask, hire a employee that can do it better, and assign him that task.
  2. Now, Mr. Ajay got the point of business and he divided his work in following way: Rent record keeping (Function with parameter, and return value) - Get the details of car which was ordered for rent - Enter the details of car and details of tenant in Excel sheet - Save the sheet - Ask cashier to complete the payment - Print the receipt including car details and tenant details - Give a copy of receipt to mechanic to drop that car to the house of tenant - Report it to manager Mechanic (Function with parameter, no return value) - Receive the car details from record keeping - Pick up the car from car park - Drive the car to the tenant's house - Give the copy of reciept to tenant - Return to the work back Car cleaner (Function with no parameter, no return value) - Check the dirty cars in car park - Collect the required tools from cleaning wardrobe - Clean dirty cards thoroughly - Put the tools back to their place Manager Mr. Ajay himself - While the working hours are on: - Collect car rent details - Save it in excel sheet - Ask the car cleaner to clean cars if more than 10 cars are dirty - If this is month end, ask payroll manager for payment reports - At end of the day, calculate the business profit - Save those details - Exit from office Payroll manager (Function with no parameter, but return value) - Check the current month - Pick up each employee from the list - For each employee, calculate their monthly payment amount - Send the amount to the specified employee's bank account - Keep record of payment - Return payment reports to manager
  3. Now, the Mr. Ajay is free from trauma of work because he has to only keep track of specific tasks and all other tasks are divided into subtasks and assigned to each employee. Now, Mr. Ajay's business is touching the heights because he learnt great management skills but he didn't knew it was similar to using functions in programming.
  4. The record keeping is like Function with parameter and return value as he accept an order from tenant and returns the reciept to the mechanic to send the car to tenant's house. The Mechanic is like Function with parameter and no return value because he accepts the reciept from record keeping but doesn't return anything to record keeping; only drop the car to target tenant. Car cleaner is like Function with no parameter, no return value as once he is called to clean cars, he automatically does his work and no need to tell or return anything to his caller The Payroll manager is like Function with no parameter but return value as he only was called to get reports of payment. Rest of payment task he does on himself and returns the payment reports to the manager Mr. Ajay. Mr. Ajay is like still a main function as he keeps track of people of his business for a day. He also check for certain conditions like necessity for cleaning car and completing payment every day.