Write a complete C++ program that solves the following problem. Give your source file a meaningful name,
Question:
Write a complete C++ program that solves the following problem. Give your source file a meaningful name, such as gasprices.cpp. Do not use any global data except for any constant values you may need and your file stream variables.
1. Create a datafile that contains the names of 50 cities and their respective gas prices. You can look these up online, use local prices, and/or make up a few (as long as your prices are reasonable!). Your city names should be a single string with no spaces in them to simplify the reading process.
2. Write a program reads the city names and respective gas prices into 2 single-subscripted arrays in your program - one of type string, the other of type double. (We would call these "parallel arrays" - each corresponding location shows the city name and gas price for each city). Your program should do the following:
a. Find and display the average gas price.
b. Find and display the highest gas price, along with a list of all cities at that gas price.
c. Find and display the lowest gas price, along with a list of all cities at that gas price.
Your program must use at least 2 well-defined functions. You can, if you wish, use more. Direct all output to the console window. All output should be well labeled and formatted.
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill