, , , hours wr getData(), getData wr.
main: (initialize)
Variable Value Memory Address
hours 0 44444
wr 0.0 55555
getData: wr ,
Variable Value Memory Address
hours 0 66666
wr 0.0 77777
: - 10, wr - 20
Variable Value Memory Address
hours 10 66666
wr 20.0 77777
main: wr stil 0
Variable Value Memory Address
hours 0 44444
wr 0.0 55555
:
( Java):
class Salary
{
int hours;
double wr;
}
getData Salary Pay
public static Salary getData()
{
Scanner kb = new Scanner(System.in);
Salary sal = new Salary();
System.out.print("Please enter your wage rate ");
sal.wr = kb.nextDouble();
System.out.print("Please enter your hours work ");
sal.hours = kb.nextInt();
return sal;
}
public static double calculatePay(Salary sal)
{
}