You borrow money for 4 years. The total amount that you repay is $7,840, which includes $840 in simple interest. How much was the principal? What was the annual interest rate?