
IN C++,
You are to use the started code provided with QUEUE Container Adapter methods and provide the implementation of a requested functionality outlined below.
Scenario:
A local restaurant has hired you to develop an application that will manage customer orders. Each order will be put in the queue and will be called on a first come first served bases.
Develop the menu driven application with the following menu items:
- Add order
- Next order
- Previous order
- Delete order
- Order Size
- View order list
- View current order
Order management will be resolved by utilization of an STL-queue container’s functionalities and use of the following Queue container adapter functions:
- enQueue: Adds the order in the queue
- DeQueue: Deletes the order from the queue
- Peek: Returns the order that is top in the queue without removing it
- IsEmpty: checks do we have any orders in the queue
- Size: returns the number of orders that are in the queue
While adding a new order in the queue, the program will be capable of collecting the following order information:
- Name on order
- Order description
- Order total
- Order tip
- Date of order
The started code:
#include <iostream>
#include <queue>
#include <string>
using namespace std;
class patient {
/ /Creates class for patient variable
public:
string firstName;
string insuranceType;
string lastName;
string ssn;
string address;
string visitDate;
};
queue <patient> p;
void enqueue()
//Enqueues patient details from console input
{
patient pa;
cout << "Please enter Patient First Name:";
cin >> pa.firstName;
cout << "Please enter Patient Last Name:";
cin >> pa.lastName;
cout << "Please enter Patient insurance type:";
cin >> pa.insuranceType;
cout << "Please enter Patient SSN:";
cin >> pa.ssn;
cout << "Please enter Patient Address:";
cin.ignore();
getline(cin, pa.address);
cout << "Please enter Patient Date of Visit:";
cin >> pa.visitDate; p.push(pa);
}
patient dequeue()
//Removes patient from queue
{
patient pa;
if (!p.empty()) {
pa = p.front();
p.pop();
}
return pa;
}
void peek()
//Returns current patient at the front of the queue
{
if (!p.empty()) {
patient tmp = p.front();
cout << "Patient Name is " << tmp.firstName<< endl;
}
}
int main() {
int x = 0;
int n;
patient last;
while (x == 0) {
//Prompts for Menu Selection while selection = 0, which is defaulted to 0
cout << "Welcome to Dental Associates of Kansas City" << endl; cout << "**************************************************" << endl;
cout << "To get started, please select an option from the menu below:" << endl;
cout << "1. Add patient" << endl;
cout << "2. Next patient" << endl;
cout << "3. Previous patient" << endl;
cout << "4. Delete patient" << endl;
cout << "5. View current" << endl;
cout << "6. Exit this program" << endl; cout << "Enter the number of the action you would like to perform: ";
cin >> n; if (n == 1) {
enqueue();
} else if (n == 2) {
last = dequeue();
peek();
} else if (n == 3) {
cout << last.firstName << endl;
} else if (n == 4) {
last = dequeue();
} else if (n == 5) {
peek();
} else if (n == 6) {
exit(0);
}
}
}

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

- In C Programming: Write a function printCourseRow() which receives a course pointer and prints all its fields as a single row. Use proper formatting so that when we print 2 or more courses as rows, the same members align below each other. Test the function, but don’t include the testing code in your homework.Upload a screenshot of a sample output.arrow_forwardwrite in c++Write a program that would allow the user to interact with a part of the IMDB movie database. Each movie has a unique ID, name, release date, and user rating. You're given a file containing this information (see movies.txt in "Additional files" section). The first 4 rows of this file correspond to the first movie, then after an empty line 4 rows contain information about the second movie and so forth. Format of these fields: ID is an integer Name is a string that can contain spaces Release date is a string in yyyy/mm/dd format Rating is a fractional number The number of movies is not provided and does not need to be computed. But the file can't contain more than 100 movies. Then, it should offer the user a menu with the following options: Display movies sorted by id Display movies sorted by release date, then rating Lookup a release date given a name Lookup a movie by id Quit the Program The program should perform the selected operation and then re-display the menu. For…arrow_forwardA declared name is only valid within a region of code known as the name's scope. Example: A variable “globalVar_1” declared in main() is only valid within main(), from the declaration to main()'s end. True or falsearrow_forward
- write a program for a library automation which gets the isbn number, name, author and publication year of the books in the library. the status will be filled by the program as follows: if publication year before 1985 the status is reference else status is available, the information about the books should be stored inside a linked list. the program should have a menu and the user inserts, displays, and deletes the elements from the menu by write a selecting options. the following data structure should be used. struct list char isbn[ 20 ]: char namei 20 ]. char authori 20 ]: int year; char status[200j: struct list "next, jinfo, wedoad n un posn ag pinogs nuu sulnogoj l press 1. to insert a book press 2. to display the book list press 3. to delete a book from listarrow_forwardYou are to use the started code provided with QUEUE Container Adapter methods and provide the implementation of a requested functionality outlined below. The program has to be in c++, and have to use the already started code below. Scenario: A local restaurant has hired you to develop an application that will manage customer orders. Each order will be put in the queue and will be called on a first come first served bases. Develop the menu driven application with the following menu items: Add order Next order Previous order Delete order Order Size View order list View current order Order management will be resolved by utilization of an STL-queue container’s functionalities and use of the following Queue container adapter functions: enQueue: Adds the order in the queue DeQueue: Deletes the order from the queue Peek: Returns the order that is top in the queue without removing it IsEmpty: checks do we have any orders in the queue Size: returns the number of orders that are in…arrow_forwardIn C++,arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





