Shelby drives her scooter at a speed of $30$ miles per hour if it is not raining, and $20$ miles per hour if it is raining. Today she drove in the sun in the morning and in the rain in the evening, for a total of $16$ miles in $40$ minutes. How many minutes did she drive in the rain?
Let $x$ be the time she drove in the rain. Thus, the number of minutes she did not drive in the rain is $40-x$ . Since we are calculating the time in minutes, it is best to convert the speeds in minutes. Thus, the speed per minute when it is not raining is $\frac{1}{2}$ miles per minute, and $\frac{1}{3}$ miles per minute when it is raining. Thus, we have the equation, $\frac{1}{2} \cdot (40-x) + \frac{1}{3} \cdot x = 16$ Solving, gives $x$ = $24$ , so the amount of time she drove in the rain is $24$ minutes. $\fbox{24}$.