Plotting the functions is highly recommended.
For A, the area under [tex]f(x)=3[/tex] over the interval [1, 2] is the area of rectangle with height 3 and width 2 - 1 = 1, so the area is
[tex]\displaystyle\int_1^23\,\mathrm dx=3\cdot1=3[/tex]
For B, the area under [tex]f(x)=1-|x-1|[/tex] plotted over the interval [0, 2] is the area of a triangle with height 1 and base length 2, so the area is
[tex]\displaystyle\int_0^2(1-|x-1|)\,\mathrm dx=\frac12\cdot1\cdot2=1[/tex]