If you let N = cost of a notebook, and p = cost of a pencil, then we have;
N = p + 98
6 pencils will cost 6p dollars
3 notebooks will cost 3(p + 98) dollars
Together, the 6 pencils and 3 notebooks cost 6p + 3(p + 98) = 6p + 3p + 294 = 9p + 294 dollars