Java Reference
In-Depth Information
Figure 5-10.
19.
At the Error/Warning Settings Changed window, click the Yes button.
Notice that the warning icon is removed from the EmployeeFrame, TNT button, and UsefulFrame classes.
Tutorial: Converting and Calculating
To calculate the gross salary of the employee, EnterEmpInfo must:
1.
Convert the text in empPayRate to a numeric primitive
2.
Multiply the numeric primitive pay rate by 40
3.
Display the result
Inside of the EnterEmpInfo's actionPerformed method:
1.
Create two double method variables called doubleEmpPR and doubleGross.
Use the wrapper class Double to convert empPayRate to double and then assign it to
double-EmpPR as follows:
2.
doubleEmpPR = Double.parseDouble(empPayRate);
3.
Insert the following formula to calculate the gross salary:
doubleGross = doubleEmpPR * 40;
 
Search WWH ::




Custom Search