We will determine the number of pizza slices and nachos he bought as follows:

Here, p represents pizza slices and n nachos.
and:

***
We solve the first function for either p or n:

And using this, we replace in the second function:

Now, we determine the value of n:

Now, we replace the value of n in the first equation and determine the value of p:

So, he bought 6 slices of pizza and 4 units of nachos.