In this assignment, you’re going to develop a simulated community message board solved

$20.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (1 vote)

Read the entire assignment carefully before beginning. In this assignment, you’re going
to develop a simulated community message board where users can post items they have
for sale or search for items they want to buy. Your program will search for matches, e.g.
there is a bike for sale for $50 and a bike wanted, where the buyer will pay up to $60,
and remove items from the message board as they are sold. Users have the option of
posting and searching for as many items as they choose before they quit the program.
Getting started
Your program should display a menu with the following selections:
1. Insert an item.
2. Search for an item.
3. Print the message board.
4. Quit.
Use the following C++ print and input statements for your menu:
cout << "1. Insert an item." << endl; cout << "2. Search for an item." << endl; cout << "3. Print the message board." << endl; cout << "4. Quit."<< endl; getline(myFile, choice); Note: the getline() command assumes you have a variable called “choice” defined and that it’s a string. This menu should be displayed after every transaction is complete unless the user selects Quit. The user can select the option they want using the number for the option. For example, to add an item, they type 1. Item types There are only five types of items: bike, microwave, dresser, truck and chicken. When you prompt the user, your prompt needs to include the exact text shown here: "Enter the item type-b,m,d,t,c:" "Enter the item cost:" The user types the first letter of the item type to indicate the type they want to add. Data in the message board is stored as a 2D array. One dimension of the array is the number of items in the message board and the other dimension is the parameters for each item. Each item on the message board contains the type and the cost. Assume you have an array called msgBoard and you want to store the following three items. bike, $50 truck, $1000 microwave, $10 Your array would look like msgBoard[0][0] = ‘b’; msgBoard[0][1] = ‘50’; msgBoard[1][0] = ‘t’; msgBoard[1][1] = ‘1000’; msgBoard[2][0] = ‘m’; msgBoard[2][1] = ‘10’; All values are stored as strings in this example. Insert an item If the user selects 1 to add an item, they should be prompted for the type of item to add and the cost of the item. When an element is added to the message board array, it should be added at the first available position. Don’t sort the data, we will be running test cases with expected output for each input. Duplicates are also okay. Search for an item When the user selects 2 to find an item, they should be prompted with the item type, and the maximum price they are willing to pay for the item. Your code should then search the array and return the first item with the correct type and a cost that is less than or equal to the price that the user will pay. Use the following text in your prompts: "Enter the item type-b,m,d,t,c:" "Enter the maximum item cost:" For example, if the user types b and 50, they want a bicycle and are willing to pay up to $50 for it. Your program should find the first bicycle in the list that sells for $50 or less. If a match is found, print “Sold