The right senteces is "Beginning in the seventeenth century, the rulers of Japan (why did they do this?) had forbidden contact with foreigners." because usually <span>punctuation and capitalization are left ouside of the parenthesis, expect when it is after a ? or a dot. </span>In this case the period inside the parenthesis is simple and it has a question mark, so it goes without capitalization at the beginning and the question mark is right before the conclusion of the parenthesis.