Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For C++ Programming Restaurant Simulation This one is like \"weird\" on how they

ID: 3740258 • Letter: F

Question

For C++ Programming  Restaurant Simulation

This one is like "weird" on how they are asking for the spec so any help would be helpfull!

The Major/Main points is SIMULATE ACTIVITIES OF A RESTAURANT

* to simulate activities in a restaurant.

:No Linear Programming(Function Protoypes)

- Header files

Thanks for the Help I know its alot to ask!

Below is what we can go by but it doesnt need to be exact just needs to simulate activities for a restaurant.

Restaurant Simulation

Overview

The idea behind this program is to simulate activities in a restaurant. This simulation could be used by a manager to optimize the number of waitresses, tables, etc. to efficiently handle the flow of customers. This program should be designed to allow the user to customize the parameters of the simulation so that a restaurant manager of any restaurant could configure it to work for their restaurant. You should envision your program being used as a planning tool to help a restaurant manager/owner determine the amount of staff they need working during different times of the day or week based on their customer patterns. The simulation shoudl run for at least 24 hours.

Detailed Description

This program should give users the option to create a file with a text editor that contains the parameters or use an interactive interface to set the parameters. The parameters that should be considered for this simulation include the following:

1. Level of business. This is the combination of the rate at which people arrive and the size of their party

slow - < 50% seated and at least 75% parties of 2 or less

busy - at least 75% seated and 50% parties 2 or more

slammed - 100% seated 75% parties of 3 or more

(note: you may adjust these parameters within reason)

2. The number of tables (seating 4 people maximum at a table and all tables have the same size). A restaurant can have as many tables as the user wants.

3. The type of the restaurant. Cook time determines how long a table will be occupied. A restaurant is one of the following types:

- Menu tiers - continental < 5 min.

- bistro between 10 - 12 min.

- gourmet > 15 - 30 min.

4. Wait staff skill level. Each wait staff member must be given a skill level. This time is multiplied by the number of people in the party and added to the service time for thep party.

- newbies -  > 5 min/per person

- seasoned - between 3 - 5 min/per person

- professional - < 2 min/per person

(note: you can determine how you want to distribute the skill level of wait staff)

Input

The input files for the configuration should have at least the following configuration for a restaurant:

<name of restaurant>

<level of business>

<number of tables>

<type of restuarant>

You may add other features to this file. In addition, there should also be an option to interactively enter this data instead of using a a file.

Output

The output for this program should contain at least the following information:

1. Output that describes activities in the simulation as it is running (see the bank teller program for ideas)

2. A final report when simulation is complete that contains at least the following:

The values of the configuration parameters

The average waiting time for parties

The average number of parties waiting for a table

The average turnaround time: the time from when the party arrives to when they leave the restaurant

You may add information to the output.

Explanation / Answer

C++ language program

Copiable code:

#include <iostream>

#include <time.h>

#include <stdlib.h>

using namespace std;

class Customer{

public:

int WaitTime, ServiceTime, OrderCounter, ServiceCounter, OrderTime, test;

Customer *next;

Customer(){

test = 0;

OrderCounter = 0;

WaitTime = 0;

ServiceTime = 0;

OrderTime = 0;

next = NULL;

}

};

class Queue{

public:

Customer *top, *bottom;

int totalWaitTime, totalCustomers;

Queue(){

bottom = NULL;

top = NULL;

totalWaitTime = 0;

totalCustomers = 0;

}

void incrementWaitTime(){

Customer *temp;

temp = top;

if(top == NULL){

return;

}

else{

if(temp->next == bottom){

temp->WaitTime++;

}

else{

while(temp->next != bottom){

temp->WaitTime = temp->WaitTime + 1;

temp = temp->next;

}

}

}

}

void displayContents(){

Customer *temp;

temp = top;

while(temp!= NULL){

cout << temp->test << "---->";

temp = temp->next;

}

cout << endl;

}

void newCustomer(int x){

Customer *temp = new Customer;

temp->OrderTime = x;

if(top == NULL){

top = bottom = temp;

totalCustomers++;

cout << "There is a new customer." << endl;

}

else{

temp->next = top;

top = temp;

totalCustomers++;

cout << "There is a new customer." << endl;

}

}

void removeCustomer(){

Customer *chase, *follow;

chase = follow = top;

if(top == NULL){.

cout << "No customers are in line.. there's nothing to remove." << endl;

return;

}

else{

if(top->next == NULL){

//Only one customer

delete top;

top = NULL;

bottom = NULL;

return;

}

while(chase->next != NULL){

follow = chase;

chase = chase->next;

}

delete chase;

bottom = follow;

follow->next = NULL;

}

}

void checkStatus(){

if(top == NULL){

bottom = NULL;

return;

}

else if(bottom->OrderCounter != bottom->OrderTime){

bottom->OrderCounter++;

bottom->WaitTime++;

}

else{

totalWaitTime = totalWaitTime + bottom->WaitTime;

removeCustomer();

}

}

};

int main(){

Queue Restaurant;

int Clock = 1, totalCustomers = 0;

float probArrival = 0;

srand(time(NULL));

int number, orderTime, TotalWaitTime, TotalServiceTime;

while(Clock < 1140){

while(Clock < 120){

number = rand();

number = number%10+1;

if(number >=1 && number <= 3){

orderTime = rand();

orderTime = orderTime%6 + 1;

Restaurant.newCustomer(orderTime);

cout << "The time is: " << Clock << " minutes." << endl;

Clock++;

}

else{

Restaurant.checkStatus();

Restaurant.incrementWaitTime();

cout << "The time is: " << Clock << " minutes." << endl;

Clock++;

}

}

Clock = 1140;

}

cout << "There were " << Restaurant.totalCustomers << " customers. " << endl;

cout << "Average wait time was: " << Restaurant.totalWaitTime / Restaurant.totalCustomers << " minutes per customer." << endl;

system("pause");

return 1;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote