Computer Science 121
Assignment 2
Due: February 10, 1999

  1. Write a program to display a tax table. The table should display the tax on purchases of $1.00, $2.00, $3.00, $4.00, $5.00, $6.00, $7.00, $8.00, $9.00, and $10.00. The tax rate is 8.25%. The table should have two columns, the first being the amount of the purchase and the second the tax on that amount.
  2. Write a program to read in two prices, add them together, calculate the tax on the sum and then display the tax and the total price on the screen.
  3. Write a program to compute a person's body mass index. To do so, multiply the person's weight in pounds by 705. Then divide this result by his or her height in inches squared. For example, if the person weighs 120 pounds and is 5 feet 2 inches tall (62 inches), her body mass index is (120 * 705) / (62 * 62) or 22. Prompt for and read in the height and weight and then calculate and display the body mass index.