Computer Science 121
Assignment 6
Due: March 29, 1999

  1. Write a program to read in three names and print them out in order. For example, if the names read in are Sally, David, and Mabel, they should be displayed in the order David, Mabel, Sally. The program should handle all six possible orders.
  2. Write a program with two functions besides the main function. The first should read in a price and product name and return them to the main function in reference parameters. The main function should call this function twice in order to read in two prices and two names. It should then decide which product is more expensive and call a second function that will display the name and price of the more expensive product on the screen.
  3. Write a program similar to program 2, except that it should use the first function to read in 10 products and prices. It should then determine the most expensive product and call the second function to display its name and price on the screen.