Design one of 4 type of FIR filter by window function?
The topic your referring to goes by various names such as "FIR Filter Design Using Windows", "Windowing Method of FIR Filter Design", "Window Designed FIR Filters", etc. I'll bet your class textbook covers this topic (most DSP books do). Meaningful answers to your questions require more space than is available here. I suggest you have a look at the following web page (and its following three pages) for a decent introductory discussion of that topic:

http://www.bores.com/courses/intro/filters/4_fir.htm

Then have a look at Section 2.2 of the following web page:

http://www.mikroe.com/chapters/view/72/chapter-2-fir-filters/