Question: Can anyone explain how to read this code and what it will do?

```
'D' * (num % 1000 / 500)

```

It is from a method for converting integers to Roman numerals. I don't understand how it functions.

Answer: 
The expression (num % 1000 / 500) means "if you have in your last 3 digits a number greater than 500 then evaluate to 1 otherwise evaluate to 0" 

"D" \* (0 or 1) is determining whether to put "D" on the roman number or not.
The modulus `%` and division `/` operators have the same precedence.

So *associativity*, which is from left to right for these operators, comes into play.

Therefore the expression is equivalent to `'D' * ((num % 1000) / 500)`: you are multiplying 'D' by the last 3 digits of `num` divided by 500.