How to know when to use t-value or z-value?

Normally, you use the t-table when the sample size is small ($n<30$) and the population standard deviation $\sigma$ is unknown. Z-scores are based on your knowledge about the population’s standard deviation and mean. T-scores are used when the conversion is made without knowledge of the population standard deviation and mean.
Here is a road map:
![enter image description here
In this case, both problems have known population mean and standard deviation. Thus you should only decide based upon whether the sample size is below $30$.
The 1st problem has $n=30$, so you should use z-table.
The 2nd problem only has $n=10$, so you should use t-table.

Image Source (possibly).