Okay, that shouldn't be too difficult, because by definition a first degree function has one and only one root.
So lets write some pseudocode for your problem.
For this program, let's define a function as the form y = ax + b.
In maths, when you're looking for a root you want to find the value of x when y is 0. So set y to zero, and solve for x.
0 = ax + b
-b = ax <-- subtract b from both sides
x = -b/a <-- divide both sides by a
|
So now we have derived a formula to solve for the root of the linear equation.
Now you can have a function called roots, or something. Get the user to input the value of a and b, and return the value of -b/a, which we now know to be the root of the first degree function.
So, I've given you a really good starting point. Start writing some code and if you end up needing more help I'll be around :)