Which spectral class does a star fit into if it has a surface temperature of 20,000 K?

Probably a B start. I've copied the table. See below.

Temperature
O 30,000 - 60,000 K Blue stars
B 10,000 - 30,000 K Blue-white stars
A 7,500 - 10,000 K White stars
F 6,000 - 7,500 K Yellow-white stars
G 5,000 - 6,000 K Yellow stars (like the Sun)
K 3,500 - 5,000K Yellow-orange stars
M < 3,500 K Red stars

B

A star with a surface temperature of 20,000 K falls into the O spectral class.

To determine the spectral class of a star based on its surface temperature, we need to refer to the Hertzsprung-Russell (HR) diagram. The HR diagram is a graphical representation of stars that relates their luminosity (brightness) to their surface temperature or spectral class.

To find the spectral class of a star with a surface temperature of 20,000 K, we can look at the HR diagram. The spectral class is based on the absorption lines in the star's spectrum, which are determined by its temperature. There are seven main spectral classes: O, B, A, F, G, K, and M, with O being the hottest and M being the coolest.

Generally, stars with surface temperatures above 7,500 K fall into the O, B, or A spectral classes, which are considered "hot" stars. Since the star in question has a surface temperature of 20,000 K, it falls into the O spectral class.

To verify this, you can consult an HR diagram or use online resources such as stellar classification tables or databases. These resources provide detailed information about stars, including their spectral classes based on temperature.