We can break this question up into parts. First we need to know how many moles of glucose we need to make a $\var{0.5 * b}$M solution using $\var{100 * a}$ml of water. The calculate this we use the formula
$\text{volume of liquid (in litres)} \times \text{concentration (in mol/L)} = \text{number of moles of substance}$.
This formula uses the voume in litres so we have to convert $\var{100 * a}$ml to a volume in litres. There are 1000ml in 1L so $\var{100 * a}$ml is equal to
$\dfrac{\var{100 * a}}{1000} = \var{100 * a / 1000}$L.
Putting our numbers into the formula, we find that we need
$\var{100 * a / 1000} \times \var{0.5 * b} = \var{(100 * a / 1000) * 0.5 * b}$ moles
of glucose. Finally, to work out the mass of glucose we need, we use the formula
$\text{molecular weight} \times \text{number of moles} = \text{mass of substance (in grams)}$.
We are told that glucose has a molecular wight of $\var{glucose}$ and we have calculated that we need $\var{(100 * a / 1000) * 0.5 * b}$ moles of glucose. Putting these numbers into the formula, we find that we need
$\begin{align}\var{glucose} \times \var{(100 * a / 1000) * 0.5 * b} & = \var{glucose * ((100 * a / 1000) * 0.5 * b)} \text{ grams} \\ & = \var{precround((glucose * ((100 * a / 1000) * 0.5 * b)), 2)} \text{ grams to 2 d.p.}\end{align}$
of glucose to make a $\var{0.5 * b}$M solution using $\var{100 * a}$ml of water.