Computer Science 121
Assignment 4
Due: March 1, 1999

  1. Write a program to read in the names of two products and their prices. Then display the name and price of the more expensive product.
  2. Write a program with a function that computes the tax on a purchase. In the main function, read in the name of a product and its price. Call the function and compute the tax. Next read in whether or not the product was purchased over the Internet. Then display the final bill with tax included if the product were not purchased over the Internet and tax-free if it were.
  3. Write a program with a function that computes and returns a person's body mass index. Refer to assignment 2 for the formula. In the main function, call the function and then display a message that shows whether the index is above or below 25.