The most important thing to remember about opamps is that the output will adjust to whatever voltage it takes to make the voltage at the two inputs equal to each other.
Go ahead and sketch up your own attempts at a solution and then post it here. I am sure you will find many members will be able to assist you in clearing up any confusion you may be encountering.
You have been handed some very good hints from mik3 and joejester. Now is a good time to take a moment and work through the derivation steps to see if you can duplicate their results.
thanks mik3, i also got the same answer for b) but i couldn't get the answer for a)
and thanks joejester for giving the actual formula.. i will try to understand how you got to that
Think in terms of voltages. You know what the voltage is at the noninverting input with the switch in either state. What conditions would apply to match the same voltage on the inverting input.