For the given question, Let x represent the number of weeks and y represent the total amount of money in the account.
Peter and Sam both opened a savings account when they got their first job.
Peter started with 150 in his account and deposits $30 each week.
So, the equation of Peter will be:

Sam started with $90 in his account and deposits $45 each week.
So, the equation of Sam will be:

2. we will find when Peter and same will have the same amount in their account
so,

Solve the equation to find the value of (x):

Substitute with (x) into equation y1 or y2 to find the amount in their account
so,

So, the answer will be:
Peter and same will have the same amount in their account at 4 weeks. At this time they will both have $270 in their accounts