5.0 moles of a gas is put into a container of 2.0L. More gas is added to the flask s othat there is now 15 moles of the gas present. What must the new volume be if temperature and pressure are to remain constant?

Probably there are easier ways to do this but I would approach it this way.

Use PV = nRT for the first scenario. You know n, V, R and T (T is not listed but since it doesn't change, make up a number for it--300 sounds ok to me). Solve for pressure.
Now use PV = nRT for the second scenario. You know n, R, use 300 for T, and use pressure you calculated above. Solve for the new volume.(I think the answer should come out to about 6 L but check my thinking). I can show you the easier (shorter but perhaps a little harder to understand) way if you are interested.

what if the question doesnt say that the temperature and pressure stay constant. for example..3.0L of a gas has a pressure of 12.0 atm. What is the new pressure if the gas is expanded to 17.0L?....would you assume that the temperature would stay the same or is there another way to solve this?

The procedure doesn't change.

Use PV = nRT for the first scenario. You know n, R, T, and V. Calculate P.

Then the second scenario, calculate V for PV = nRT using whatever the new T, P, and n values are.

If that is a new question you posted, the procedure I wrote will not solve that one BUT the procedure is still the same. It would be easier to use P1V2 = P2V2.

To find the new volume of the gas when 15 moles are added while keeping the temperature and pressure constant, we can use the ideal gas law equation: PV = nRT, where P is the pressure, V is the volume, n is the number of moles, R is the ideal gas constant, and T is the temperature.

Since the temperature and pressure are constant, we can rewrite the equation as:

V₁/n₁ = V₂/n₂

Where:
V₁ = initial volume
n₁ = initial number of moles
V₂ = final volume (what we want to find)
n₂ = final number of moles

Given information:
n₁ = 5.0 moles
V₁ = 2.0 L
n₂ = 5.0 moles + 15 moles = 20 moles

Now, we can solve for V₂ using the equation:

V₁/n₁ = V₂/n₂

Substituting the given values:

2.0 L / 5.0 moles = V₂ / 20 moles

Simplifying the equation:

0.4 L/mole = V₂/20 moles

Cross multiplying gives:

V₂ = 0.4 L/mole * 20 moles

V₂ = 8.0 L

Therefore, the new volume when 15 moles of gas are added while keeping temperature and pressure constant is 8.0 L.