I'm doing 2 statistics exercises:

The 1st: An electrical firm manufactures light bulbs that have a length of life that is approximately normally distributed with a standard deviation of 40 hours. If a sample of 30 bulbs has an average life of 780 hours, find a 96% confidence interval for the population mean of all bulbs produced by this firm.

The 2nd: A random sample of 10 chocolate energy bars of a certain brand has, on average, 230 calories per bar, with a standard deviation of 15 calories. Construct a 99% confidence interval for the true mean calorie content of this brand of energy bar. Assume that the distribution of the calorie content is approximately normal.

I look at the solution my teacher provided. The 1st one use z-table and the 2nd use t-table. Could anyone tell me how to know (from questions) whether to use z or use t? And please show me the differences between 2 exercises here that make one use z-value and the other use t-value.

Thank you in advance for any help you can provide.