From testing it seems as though the the for loop will insert the letter and then fill the rest in with blank spaces, also the while loop will not loop the 3 time ether.
Carey Brown wrote:Sorry Randy, I'm afraid that won't work...
Could you restructure this sentence slightly to make your meaning clearer? Perhaps an example?
Wes James wrote:I shouldn't set it as a string and then just grab the first character? Is it bad practice to do it like this?
Carey Brown wrote:You should put it into a String first so that you could check that the String length is *exactly* one character long before proceeding.
Wes James wrote:Which is better and conforms to the best practices.
I wrote:The cons to the second approach is that you have an extra intermediate variable which you have named letter and now you're forced to give the value you're actually interested in a less expressive name of l. To me, that's worse.
Junilu Lacar wrote:Generally, I try to avoid temporary, single-use variables. The exception is that if it can help me isolate and explain a complex calculation.