Question: Could you please be kind enough and make this program by C++? Thank you! Your task is to create a utility program that would allow

Could you please be kind enough and make this program by C++?

Thank you!

Your task is to create a utility program that would allow users to add/view/query Knicks tickets on sale at TicketMaster.

Step A [20 points]: Declare array variables that will hold team name (that the Knicks is playing against), section number (of the ticket), and the price (of the ticket). These variables must be declared in the main function. Global variables are not allowed!!.

Step B: Provide user with the following options and let user choose what they want to do. Each task must have its own function (except Exit). main() will call the appropriate function based on user input.

1 Add New Ticket [30 points]: This will allow user to add a new ticket to the system. Ticket information should be stored in the arrays along with other tickets.

2 Display All Tickets[30 points]: This will basically display all the tickets in a formatted manner on the screen.

3 Display Tickets By Budget[60 points]: This will ask user for his/her budget and display only the tickets that are priced less than or equal to this budget price.

4 Display Cheapest Price By Event[70 points]: This will ask user which event they are interested in. User basically enters the name of the team Knicks is playing against. Your program should find the cheapest ticket for that game. For this functionality, I need you to return the cheapest ticket price back to main() and let main() display it to user. So unlike other functions, this particular function will return a value (cheapest ticket price at that event) and this value will be displayed to user in the main() function.

5 Exit[20 points]: user wants to exit the program.

#include  // we always include this for cin, cout #include  // if you need string data type. #include  // if you will do file IO. // just so that we can write "cout" instead of "std::cout" using namespace std; void ReadDataFromFile(string functeam[], int funcsection[], double funcprice[], int &funccount); int main() { string team[1000]; int section[1000]; double price[1000]; int count = 0; ReadDataFromFile(team, section, price, count); int choice; do { cout << "1- Add New Ticket" << endl; cout << "2- Display All" << endl; cout << "3- Display By Budget" << endl; cout << "4- Cheapest By Event" << endl; cout << "0- Exit" << endl; cout << "your choice: "; cin >> choice; if (choice == 1) { cout << "You want to add new ticket." << endl; } else if (choice == 2) { cout << "You want to display all tickets." << endl; } else if (choice == 3) { cout << "You want to display tickets by budget." << endl; } else if (choice == 4) { cout << "You want to display cheapest tickets by event." << endl; } } while (choice != 0); system("PAUSE"); return 0; } void ReadDataFromFile(string functeam[], int funcsection[], double funcprice[], int &funccount) { // initialize arrays with some initial values, // or read the information from file. // we will read the file (if exist) and populate arrays. ifstream fIn("ticketmaster.txt"); if (fIn) { while (!fIn.eof()) { fIn >> functeam[funccount]; if (functeam[funccount] == "") { break; } fIn >> funcsection[funccount]; fIn >> funcprice[funccount]; funccount++; } fIn.close(); } } 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!