Thank you very much! I'm going to try and also pop that code into a compiler off the internet and see how it comes out (format) and I'll compare it to your latex answer. Did you use your code to come up with that or simply to verify?
Because you initially posted so many questions the thread became so convoluted that most people probably can't be bothered wasting their time trying to get their head around it.
That's why people get told the following:
Furthermore, you did the thread no favours with all the off-topic posts that I have had to delete to try and get this thread more coherent. All those issues were raised and discussed in the Questions and Comments subforum. There was no need for the discussion in this thread.Please don't post more than two questions in a thread. Otherwise the thread can get convoluted and difficult to follow. It is better for forum organization and better for you to get your questions answered in a more timely manner if you start new threads as necessary for remaining questions. eg. If you have five questions, post two of them in two threads and start a new thread for the remaining one etc.
And if the question has more than two parts to it, it is best to post only that question and its parts in the thread and start a new thread for other questions.
The code was used to generate the LaTeX. If you set v=false at the beginning then only the answer will be printed; else the steps will be shown as well. All I added when putting it in my MHF post were line breaks and [tex][/tex] tags.
Regarding a compiler off the internet... javac is perfectly good and comes with the JDK off of sun/oracle's website. Eclipse also has its own compiler.