Originally posted by Ernest Friedman-Hill:
Ask yourself "Where does the variable 'hours' get set to equal the number of hours entered into the text field?"
Ernest,
Thank you sooooo much. I figured what silly mistake i was doing. I am a beginner striving to do good programming. I got the output now. This is the code i had to add to fix the problem.
public int calculateTotal()
{
hours = Integer.parseInt(hourTF.getText());
mins = Integer.parseInt(minTF.getText());
secs = Integer.parseInt(secTF.getText());
totalMin = hours * 60 + mins + secs / 60;
totalCost = totalMin * 10;
return totalCost;
}
Thank again,
Kanaka