Running a set of codes given in R for regression analysis

I am given a set of codes in R for simple and multiple logistic regression analysis. I am supposed to run this set of codes and get the same output provided. But I got error messages when I ran the codes.

I need help in running this set of codes. Please review the codes and instruction given and the error messages in R. 

Let me know what did I do wrong in running this set of codes. Please provide me a detail set of instruction step by step how to run it. Please revise the code if necessary so that I just copy and paste into my desktop computer and run it to get the same output as provided by my prof.

Thanks.