Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code the following in C++: PLEASE READ CAREFULLY Please use a class to adhere to the program specification below. This is only the first class

Code the following in C++: PLEASE READ CAREFULLY

Please use a class to adhere to the program specification below. This is only the first class used in a project I'm working on so this won't necessarily be a finished program. ANY HELP AT ALL IS GREATLY APPRECIATED. I will upvote and tell my friends with chegg to upvote too! Thank you!

image text in transcribed

=============================================================================

The restaurant tables array, we have the sizesumber of tables for each

restaurant and also, the control variable called NUMHFCS. NUMHFCS will enable us to add or subtract a restaurants.

GIVEN CODE:

// Global Constants

// Number of restaurants

const int NUMHFCS = 8;

// Number of tables in each restaurant

const int HFCSIZES[NUMHFCS] = {19, 15, 24, 33, 61, 17, 55, 37};

/ /Names of restaurant (This array is parallel to HFCSIZES)

const std::string RESTAURANT[NUMHFCS] = {"The Salubrious Bistro", "What the Kale?", "Lettuce Enjoy", "Vegan Nights", "Pasta is a Planet", "The Meatless Miracle", "The Pesky Pescatarian", "The Fine Fettle"};

Build each restaurant by creating dynamic objects (on the heap).

Each time we put our patrons at a table for the chosen restaurant, we will create an

object from our class aptly named Restaurant. Each Restaurant object will contain the following:

restaurant number (short int)

table number (short int)

a unique five-digit patron ID number (int)

patron name (string)

patron meal number (short int)

There has to be a local pointer allocated for each object. One idea is

for that pointer to be in an array of local pointers to the type Restaurant (something

like Restaurant *arrOfPtrs[261], or eight arrays of pointers).

Restaurant number is one of the available healthy food restaurants. This is entered into the program, and must be

validated and within range (use NUMHFCS). The program must determine the next available free

table (table number). If there are none then the program should place the user on the waiting list. Notice the program should determine to branch away from or continue on with the

table assignment process when a restaurant is full. (You MUST use a queue).

Patron ID is a randomly generated number. Name is entered by the

user into your program, and must be validated (cannot be blank). Meal

number is the number of the meal and is entered and must be validated and

within range (use NUMMEALS).

Healthy table numbers Restaurant Number 1-19 1-15 1-24 1-33 1-61 1-17 2 3 4 5 6 7 1-55 8 1-37 Healthy table numbers Restaurant Number 1-19 1-15 1-24 1-33 1-61 1-17 2 3 4 5 6 7 1-55 8 1-37

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions

Question

2. Describe how technology can impact intercultural interaction.

Answered: 1 week ago

Question

7. Define cultural space.

Answered: 1 week ago