Before going to the answer lets recall some definitions to solve this problems.
Product Rule: If one event occur in m ways and a second event occur in n ways, the number of ways the two events occur in sequence is mxn ways.
Sum Rule: If an event occur either in m ways or in n ways (non-overlapping) , the number of ways the event can occur is m+n ways.
Given Mathematics majors =18 and Computer science majors = 325
A. We need to use product rule, because the first event is picking up a Mathematics major and second event is picking up computer science major.
= 18 x 325
= 5850
B. Here sum rule is applicable, because the event is picking up a mathematics major or a computer science major
= 18 + 325
= 343