when I use parenthesis to separate the terms for the fraction, the input comes out right but it keeps giving me a wrong answer. how do i do this?
Just so you understand, I am itching to help, but need a more complete example that shows what you feel is going wrong. ;-)
You still need to provide more in order to understand your question.
You have given an example of input, but you say that when you add parentheses you get the wrong answer. So, you need to show the example with parentheses, as well as indicate what answer you expect.
Give an explicit example of what you are talking about and perhaps we can help answer your question.
z^2+10z+16/z^2+11z+24 / z^2+2z/z^2+13z+30