The Demetris Leadership Center publishes the books, DVDs, and CDs listed in the following table:
Title: Description Product Number Unit Unit Sold
Brave New World Book 110 25.50 925
Lady Gaga CD 111 16.00 275
The Forgotten DVD 112 24.50 289
Twilight DVD 113 45.50 135
The Giving Tree Book 114 24.50 540
Lil Wayne CD 115 35.50 234
The manager of the telemarketing group has asked you to write a program that will help order-entry operators to look up product prices. The program should prompt the user to enter a product number, and then will display the title, description, and the price of the product.
The program should use the following functions:
main - the program's main function
readinfo- read data from the file and store them in arrays
getprodnum- prompts the user to enter a product number. the function validates input and rejects any value outside the range of correct product numbers. Display the title, description and a price of the product.
calcsales- calculates each product's sales. calculate the total sales for all units.
binsearch- searches the array of product's sales for a specified value. if the value is found, its subscript is returned. if the value is not found, -1 is returned.
selsort- sort the list of the products in the order of their sales dollars, not units sold, from highest to lowest