1. Write an equation of the line that passes through the point P

and is perpendicular to the line with the given equation:
P(1,4); y = -2x + 4
answer y= 2 x + 2

2. Write an equation of the line that passes through the point P
and is perpendicular to the line with the given equation:
P(5,3); y = 5x + 2
answer y= 5x + 28

No, for both

The slopes of perpendicular lines are negative reciprocals of each other.
that is, you have to change the sign and flip the fraction
for your first one:
slope of -2 turns into a slope of +1/2
for the second the slope of +5 turns into -1/5
(a slope of -3/4 would turn into a slope of 4/3)

back to the first one ...
your new line would be y = (1/2)x + b
plug in the given point (1,4)
4 = (1/2)(1) + b
b = 4 - 1/2 = 7/2

new equation: y = (1/2)x + 7/2

redo the 2nd in the same way