I don't understand this line and can't find its meaning on the internet... what is pad/padDigitsIt's really not that hard. You just have to one step at a time. You need to figure out how the program flow works. If I "fix it" for you, you aren't going to be able to fix the next thing. I am happy to answer questions about your attempts to make it work differently, but keep in mind, it's not broken. The code is running as it was written.
You need to think about changing the program flow to act the way you want. If there is an error condition you can fix that, if the code is written to do something different than you want, you need to rewrite it.
Code:
String padDigits(int digit)
Code:
String padDigits(int digit)
{
String str = String("0") + digit; //put a zero in front of digit
return str.substring(str.length() - 2);
}
Last edited by a moderator: