WorksheetsMethods
Total questions: 11
Worksheet time: 15mins
This is the method header (first line) of a non-return value method named Message that takes two parameters: age and name
Message (age, name)
void Message (age, name)
int Message (int age, String name)
void Message (int age, String name)
This is the method header (first line) of a return value method named BMI that takes two parameters: weight and height
void BMI (double weight, height)
void BMI (double weight, double height)
double BMI (double weight, double height)
double BMI (weight, height)
This is the method header (first line) of a non-return value method named Store that accepted three argument (name, code and price)
void Store (Cname, tagcode, iprice)
double Store (String Cname, char tagcode, double iprice)
void Store (String Cname, char tagcode, double iprice)
void Store (double iprice, String Cname, char tagcode)
public class Volume
Create object that will use to call a method in the class.
Scanner mtd = new Volume (System.in);
Volume mtd = new Volume ( );
New Volume mtd = Volume ( );
Volume mtd = Volume ( );
public class SST
Create object that will use to call a method in the class.
Scanner Obj= new SST ( );
New SST Obj= SST( );
SST Obj = New SST ( );
SST.Obj = New SST ( );
Call the method in the class by sending 3.00 as argument. Given:-
Class Name : Rate
Obj to call method: mtd
Method name: Calculate
Calculate.Rate.mtd(3.00);
mtd=Calculate(3.00);
mtd.Calculate(double 3.00);
mtd.Calculate(3.00);
Call the method in the class by sending 'K' as argument. Given:-
Class Name : Sample
Obj to call method: obj
Method name: Rare
obj=Sample('K');
obj.Rare('K');
Sample.obj.Rare('K');
obj.Sample('K');
0.2447
0.00147
4.086
0.100
3
4.2
4
0.466
Line 8
Line 11
Line 7
Line 15
double TAX (double paycheck)
double annualsalary;
TAX mtd = new TAX ( );
System.out.println("The tax amount to pay is : " + mtd.TAG(annualsalary) );
