Write a Web program to calculate the discount rate and interest rate for a bond. If a bond is purchased for n dollars and sold one year later for m dollars, then the discount rate is

m-2/m and the interest rate is m-n/n, where each is expressed as a percent.

To calculate the discount rate and interest rate for a bond, you can use JavaScript to create a web program. Here's an example of how you can achieve this:

HTML:
```html
<!DOCTYPE html>
<html>
<head>
<title>Bond Calculator</title>
<script src="script.js"></script>
</head>
<body>
<h1>Bond Calculator</h1>
<label>Purchase Price: </label>
<input type="number" id="purchasePrice"><br><br>
<label>Sale Price: </label>
<input type="number" id="salePrice"><br><br>
<button onclick="calculateRates()">Calculate</button><br><br>
<p id="discountRate"></p>
<p id="interestRate"></p>
</body>
</html>
```

JavaScript (script.js):
```javascript
function calculateRates() {
var purchasePrice = parseFloat(document.getElementById("purchasePrice").value);
var salePrice = parseFloat(document.getElementById("salePrice").value);

var discountRate = ((salePrice - 2) / salePrice) * 100;
var interestRate = ((salePrice - purchasePrice) / purchasePrice) * 100;

document.getElementById("discountRate").innerHTML = "Discount Rate: " + discountRate.toFixed(2) + "%";
document.getElementById("interestRate").innerHTML = "Interest Rate: " + interestRate.toFixed(2) + "%";
}
```

In this example, we have an HTML form with two input fields for the purchase price and sale price of the bond. The 'Calculate' button triggers the `calculateRates()` function defined in the JavaScript section.

Inside the `calculateRates()` function, we retrieve the values entered by the user, and then we apply the formulas to calculate the discount rate and interest rate. Finally, we update the `<p>` elements with the respective results. The `toFixed()` method is used to limit the decimal places to 2.

By running this web program in a web browser, users can input the purchase and sale prices of a bond, and the discount rate and interest rate will be calculated and displayed on the web page.