Introduction to Computer Science
CompSci 101 : Spring 2014

Problem Solving

After you have worked out an algorithm for solving a problem, write a program that implements your algorithm.

  1. Best Ticket Price

    The previous calculation for a movie ticket price might have seemed naive, but it was just one way to demonstrate some of the issues facing businesses as they try to determine how to set prices. For our purposes now, the actual calculation does not matter so long as we know there is a function that produces the correct result. What we really want to know is which ticket prices produce the most profit and which ones result in the theater losing money.

    • What range of ticket prices would it make sense to test?
    • How could you generate a list of profits resulting from a variety of ticket prices?
    • Within that list, how could you find the most profit made? least profit?
    • How would return both the ticket price and profit made?