

Parameterised Constructors
Presentation
•
Computers
•
10th Grade
•
Medium
Rajat Shenoi
Used 12+ times
FREE Resource
14 Slides • 4 Questions
1
Parameterised Constructors
User - defined methods

2
A quick revision
Advantages of a method
Header (Prototype)
Signature
Access-specifier
Return type
Parameter list
Method Block
3
continuation...
A method is a block of code which only runs when it is called.
You can pass data, known as parameters, into a method.
Methods are used to perform certain actions, and they are also known as functions.
Why use methods? To reuse code: define the code once, and use it many times.
4
Parameterised Methods
long time since I started to say next class I will teach this and there has gone about 4 classes without teaching....
finally the time has come! :)
5
Parameters and Arguments
Information can be passed to methods as parameter. Parameters act as variables inside the method.
Parameters are specified after the method name, inside the parentheses. You can add as many parameters as you want, just separate them with a comma.
The following example has a method that takes a String called fname as parameter. When the method is called, we pass along a first name, which is used inside the method to print the full name
Over to AWS...
6
Multiple Parameters
you can have as many parameters as you like :)
Note that when you are working with multiple parameters, the method call must have the same number of arguments as there are parameters, and the arguments must be passed in the same order.
over to AWS....
7
Return Values
The void keyword, used in the examples above, indicates that the method should not return a value. If you want the method to return a value, you can use a primitive data type (such as int, char, etc.) instead of void, and use the return keyword inside the method
over to AWS...
8
Purity of functions... (informal)
Function which returns a value is called a pure function
A function which may not return a value but changes the state of an object is known as impure function.
9
Some questions for you
ATB!
You will have only 10 seconds to answer each question.
Are you ready? Cause we are starting in...
10
Multiple Choice
Calling and invoking a function is same.
True
False
11
Multiple Choice
A method can use a single return statement.
True
False
12
Multiple Choice
A function cannot be defined without parameters.
True
False
13
Multiple Choice
A function body is enclosed within curly brackets.
True
False
14
Homework
Question 11 (Pg 313)
Question 12 (Pg 313)
Deadline: before next class.
15
When is the next class?
You tell me. We have 11 more classes to go.
16
What will we do in the next class?
Function Overloading
Need for Function Overloading
Defining Overloaded Functions
Written test (30 minutes, 20 marks)
17
More about the test
Questions will be sent on google classroom as an assignment.
Duration: 30 minutes
Exam will be written and NOT typed.
You will get additional 10 minutes to click a photo of the paper and send it.
Submissions after 40 minutes of releasing of question paper will lose 1 marks per minute.
Portions: Chapter 5 and 6
YOU MUST BE ON CAMERA DURING THE TEST.
18
How to submit?
You can either submit using google classroom via the method shown on the right (By choosing 'file')
Or submit the file using a link which will be easier if you are using mobile phone, because otherwise you may have to transfer to the laptop and then submit which may take time hence losing marks.
The link will be sent when the exam begins.
Parameterised Constructors
User - defined methods

Show answer
Auto Play
Slide 1 / 18
SLIDE
Similar Resources on Wayground
14 questions
EXERCISE VS DIET
Presentation
•
10th Grade
12 questions
Enzymes
Presentation
•
10th Grade
12 questions
ADVERBS OF DEGREE
Presentation
•
10th Grade
14 questions
Properties of Ionic Compounds
Presentation
•
10th Grade
13 questions
Materi Sistem Komputer Kelas X
Presentation
•
10th Grade
13 questions
K.2 Pause for People
Presentation
•
KG
10 questions
Computer Science: Systems Architecture
Presentation
•
10th Grade
14 questions
Preposition or Adverb?
Presentation
•
10th Grade
Popular Resources on Wayground
20 questions
Math Review
Quiz
•
3rd Grade
15 questions
Fast food
Quiz
•
7th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
10 questions
Identify Fractions, Mixed Numbers & Improper Fractions
Quiz
•
3rd - 4th Grade
Discover more resources for Computers
10 questions
Fact Check Ice Breaker: Two truths and a lie
Quiz
•
5th - 12th Grade
10 questions
Video Games
Quiz
•
6th - 12th Grade
10 questions
Test Your Knowledge with 15 Fun Trivia Questions
Interactive video
•
6th - 10th Grade
15 questions
Memorial Day Trivia
Quiz
•
KG - 12th Grade
12 questions
Name that Candy
Quiz
•
KG - 12th Grade
20 questions
Guess The App
Quiz
•
KG - Professional Dev...
30 questions
K/H Final Review Part 1
Quiz
•
9th - 12th Grade
40 questions
NCFE Earth and Environmental Science Released Test
Quiz
•
9th - 12th Grade