Function Pointers

Design a program that illustrates the use of function pointers. The program must allow the user to purchase books, movies, and peanuts using the menu, user interaction, base prices & shipping prices as in Assignment #3 of this course. Be sure to display the total price of all purchases rounded to the nearest penny.

You must use a function pointer named pPurchase that points to the functions

void bookPurchase(int &quantity);
void moviePurchase(int &quantity);
void peanutPurchase(int &quantity);

You may change the return type and/or parameter lists if you'd like.

These functions each return the total cost of a purchase of quantity items..

Also, create a function named printPurchase to which pPurchase is passed as a parameter. printPurchase must print the order information for the relevant item in the format

2 books cost $2.12

Call printPurchase one or more times in your program.

Use typedef to avoid the messy syntax that is assocated with function pointers.

Your program must follow the class Coding Standards. Name your project   FunctionPointers.

Preconditions:

    • None

You must hand in the following on separate pages stapled in this specified order:

    1. The source code.
    2. The screen capture of your actual form window at runtime (black text on white background) with a purchase of two of each item.