Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Method

Total questions: 15

Worksheet time: 3mins

Name
Class
Date
1.

Describe method.

a)

A component of a program in a big program.

b)

A program to perform a specific task.

c)

A component of a program written to perform a specific task.

d)

A variable that use to read an input.

2.

There two (2) types of method which are

a)

return

b)

Pre-defined

c)

User defined

d)

non-return

3.

Which one is a general structure of method.

a)

<Returnvalue type> <Method Name> (argument / s)

b)

<Modifier> < type> <Method Name> (parameter / s)

c)

public static void main (String[ ] args)

d)

<Method Name> (parameter)

4.

This is an example of a non-return method.

a)

True

b)

False

5.

In which line is representing the meaning of Pre-defined method.

a)

Line 2

b)

Line 8

c)

Line 13

d)

Line 10

6.

Method make codes more readable and easier to debug.

a)

True

b)

False

7.

The name of this method is ....

a)

Oddsum

b)

oddsum

c)

int Oddsum (int number)

d)

return totaloddsum

8.

Data type for non return method is

a)

int

b)

double

c)

void

d)

public static

9.

List all arguments that exist in this program segment:-

a)

double point, String student

b)

point, student

c)

name, mark

d)

name[i], mark[i]

10.

List all parameters that exist in this program segment:-

a)

double point, String student

b)

point, student

c)

name, mark

d)

name[i], mark[i]

11.

Create a method name Bonus that will read a basic payment and an hour variable as parameter to calculate an extra salary.

a)
b)
c)
d)
12.

What is the Output if the argument is (5500.00, 12.5)

a)

There will be no output.

b)

20, 625.00

c)

27,500.00

d)

34,375.00

13.

What is the Output if the argument is (1300.00, 15.0)

a)

9,750.00

b)

7,800.00

c)

There will be no output.

d)

5,850.00

14.

What is the Output if the argument is (1000.00, 14.30)

a)

4,290.00

b)

5,720.00

c)

7,150.00

d)

There will be no output.

15.

Why method is important?

a)

Break program into a small program and easy to debug.

b)

Easier to read and understand aspecially when involving with a big program.

c)

More practical when we need to reuse the code.

d)

Can store more similar values in a single variable.