Function return type
What does it return?
Identify parameters and its data type
What are the values of the parameters?
Error? Yes or No
100

void sample(){ }

nothing

100

string var()

{

return "hello";

}

hello

100

void sample( boolean isit){

}

isit - boolean

100

//call

float divide = div();

//definition

float divide(){

return 15/5;

}

no parameters

100

//call

rect(getX(15),200,50,60);

//definition

float getX(float a){

return a+100;

}

not an error

200

boolean isit(){}

boolean

200

//call

float c = divide(4.0,2.0);

//definintion

float divide(float a, float b){

return a/b;

}

2.0

200

void sample(){

}

no parameter

200

//call

sample(random(0,100));

//definition

void sample(float ran){

}

ran = decimal number between 0 and 100

200

boolean isit(float a);

Error

300

int sum( int a, int b){ }

int

300

void sample(){

println("hello");

}

Nothing

300

boolean isit(int a)

a - int

300

//call

print("total" + sum(10,15));

//definition

int sum( int a, int b){

return a+b;

}

a = 10 and b = 15

300

int sum( int a, int b){

return a+b,15;

}

Error!
400

float divide(float a, float b){ }

float

400

boolean isit(){

int a = 10;

if(a > 10)

   return true;

if ( a<10);

   return true;

return false;

}

false

400

float what (string word1){

}

word1 - string

400

//call

string is = sentence("hello", "world");

//definition

string sentence( string word1, string word2){

}

word1 = "hello" and word2 = "world"

400

float what (string word1){

return 4.5;

}

Not an error
500

string line(string word1, string word2){ }

string

500

int sum (){

a = 5;

b = 5;

return a+b;

}

10

500

int sum( int a, int b){

}

a - int and b - int

500

//call

boolean is = isit(5);

//definition

boolean isit( int a){

}

a = 5

500

void sample(){ 

int c = 5;

return c;

}

Error!