Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code in C language GLOBAL CONSTANTS and VARIABLES: #define ROW 12 #define COL 6 #define MAX 25 int costMatrix ROW][COL] 500,200,500,500,200,500 500,200,500,500,200,500 500,200,500,500.200,500 500,200,500,500,200,500 500,200,500,500,200.500

Code in C language
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
GLOBAL CONSTANTS and VARIABLES: #define ROW 12 #define COL 6 #define MAX 25 int costMatrix ROW][COL] 500,200,500,500,200,500 500,200,500,500,200,500 500,200,500,500.200,500 500,200,500,500,200,500 500,200,500,500,200.500 500,200,500,500,200,500 500,200,500,500,200,500 500,200,500,500,200,500 500,200,500,500,200,500; 500,200,500,500,200,500 500,200,500,500,200,500 500,200,500,500,200,500 Functions to implement 1. void initialSeats(char flightCOLI, int count); The initialSeats function takes in a two-dimensional char array created in main. It will initialize all array elements to the character O'. 'O'symbolizes the seat on the plane is open and can be taken. The int count parameter is used to symbolize the number of people who already have a seat on the plane this is a random number sent from main (use rand) to send this number). In this function it will randomly create and assign an index in the two-dimensional array with the character *X'for each person up to value of count. X' is used to symbolize that an element in the two-dimensional array is occupied. This will be used later on in the program. MAKE SURE TO SEED RAND in MAIN. Below is the way to randomly generate the seats for each passenger to take. This function should be called as soon as your program starts. Keep in mind the possibility of the randomized index overwriting X', if it was already there You have to handle that case. Beware!! int row a" rand() % ROW; int col = rand() % COL; 2. void displayMenu0: GLOBAL CONSTANTS and VARIABLES: #define ROW 12 #define COL 6 #define MAX 25 int costMatrix ROW][COL] 500,200,500,500,200,500 500,200,500,500,200,500 500,200,500,500.200,500 500,200,500,500,200,500 500,200,500,500,200.500 500,200,500,500,200,500 500,200,500,500,200,500 500,200,500,500,200,500 500,200,500,500,200,500; 500,200,500,500,200,500 500,200,500,500,200,500 500,200,500,500,200,500 Functions to implement 1. void initialSeats(char flightCOLI, int count); The initialSeats function takes in a two-dimensional char array created in main. It will initialize all array elements to the character O'. 'O'symbolizes the seat on the plane is open and can be taken. The int count parameter is used to symbolize the number of people who already have a seat on the plane this is a random number sent from main (use rand) to send this number). In this function it will randomly create and assign an index in the two-dimensional array with the character *X'for each person up to value of count. X' is used to symbolize that an element in the two-dimensional array is occupied. This will be used later on in the program. MAKE SURE TO SEED RAND in MAIN. Below is the way to randomly generate the seats for each passenger to take. This function should be called as soon as your program starts. Keep in mind the possibility of the randomized index overwriting X', if it was already there You have to handle that case. Beware!! int row a" rand() % ROW; int col = rand() % COL; 2. void displayMenu0

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_2

Step: 3

blur-text-image_3

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

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

2. Discuss the types of messages that are communicated nonverbally.

Answered: 1 week ago

Question

1. Which is the most abundant gas presented in the atmosphere?

Answered: 1 week ago