Matches columns from two different files in shell script

Hi friends,
i want to compare first columns from two different files ,if equal print the file2's second column else print the zero.Please help me...
file1:

a
b
c
d
e

file2:

a 1
c 20
e 30
desired output:
1
0
20
0
30

Welcome to the forum.

This is a problem dealt with umpteen times in here. Any attempts / ideas / thoughts from your side?