Not sure if I'm answering your question here or not...but let me try:
The metadata for this image is ALWAYS 3 bytes - 1 byte for width, 1 byte for height, 1 byte for bits-per-pixel. No matter what the dimensions are, no matter how many bits per pixel.
Note that this is abstract! The bits-per-pixel metadata just needs to hold a number in the range 1-24. So 1 byte easily covers that. But if bits-per-pixel is set to 24 it means that every pixel in the pixel data will have to be specified with 3 bytes.
The format reserves a whole byte to store the bits-per-pixel even though the bits per pixel can only range between 1 and 24. So, technically you'd only need 5 bits to store that number in the metadata but using 1-byte-offsets for metadata is more common.
Thus the calculation for total bits is (width * height * bits-per-pixel) + 24 bits of metadata. You can take that number and divide by 8 for bytes, but it might not come out as a nice integer if the student chose some bits-per-pixel value that results in odd offsets.