Question

In: Computer Science

Create a 15 row and 4 column table with each column of the data so that...

Create a 15 row and 4 column table with each column of the data so that it goes 1A 1B 1C 1D across using this code as a base

void PrintSeatingChart(seat seats[15][4], int numRows, int numColumns) {
   int i;
   int j;
   for (i = 0; i < numRows; i++) {
       cout << i + 1 << " ";
       for (j = 0; j < numColumns; j++) {
           cout << seats[i][j].seatLetter << " ";
       }
       cout << endl;
   }
}

Solutions

Expert Solution

Please find the answer below.
Please do comments in case of any issue. Also, don't forget to rate the question. Thanks.

main.cpp

#include <iostream>
#include<sstream>
#include <iomanip>
using namespace std;

struct seat{
   string seatLetter;
};

void PrintSeatingChart(seat seats[15][4], int numRows, int numColumns) {
   int i;
   int j;
   for (i = 0; i < numRows; i++) {
       cout << setw(5) << left << i + 1;
       for (j = 0; j < numColumns; j++) {
           cout << setw(5) << left << seats[i][j].seatLetter;
       }
       cout << endl;
   }
}

void GetSeatingChart(seat seats[15][4], int numRows, int numColumns) {
   int i;
   int j;

   string row;
   for (i = 0; i < numRows; i++) {
       char col='A';
       stringstream ss;
       ss<<(i+1);
       for (j = 0; j < numColumns; j++) {
           ss>>row;
           seats[i][j].seatLetter=row+col;
           col +=1;
       }
   }
}


int main( ){
   seat seats[15][4];
   GetSeatingChart(seats,15,4);
   PrintSeatingChart(seats,15,4);
   return 0;
}


Related Solutions

Create the appropriate 2 x 2 table for the data. Include appropriate row and column labels and complete the table with information provided in the scenario.
A. Researchers conducted a case control study to identify the association between alcohol consumption and esophageal cancer among men. They enrolled 187 men with esophageal cancer and 715 men without esophageal cancer. The men were asked about their regular alcohol consumption and the men were categorized as either drinking ≥80 g/day (exposed) or
In Excel, create a 2x30 data table with the left column representing a population of prey...
In Excel, create a 2x30 data table with the left column representing a population of prey and the right column representing a population of predators. Use the population model presented below. Let the starting values of the model parameters be: r = 1.3, k = 1, s = .5, v = 1.6, and u = .7 Let the starting population of P = 1.1 and Q = .4 Difference equations: P[t + 1] = P[t](1 + r(1 – P[t]/K)) -...
Use the data in the following table to create a fraction nonconforming (p) chart. The column...
Use the data in the following table to create a fraction nonconforming (p) chart. The column of np represents the number of non-conforming units. Is the process in control? (5 points) Sample n np p 1 100 7 0.07 2 100 10 0.10 3 100 12 0.12 4 100 4 0.04 5 100 9 0.09 6 100 11 0.11 7 100 10 0.10 8 100 18 0.18 9 100 13 0.13 10 100 21 0.21 Question 2 A bank's manager...
Using StatCrunch, construct a labeled contingency table (with row, column, and total %s), as well as...
Using StatCrunch, construct a labeled contingency table (with row, column, and total %s), as well as the contribution to the chi-square statistic, for the following set of data for 300 people:                                                 Group A          Group B          Group C          Total             Had flu shot                     20                   30                    38                   88             Didn’t have flu shot         80                   70                    62                 212             Total                               100                 100                  100               300         Is the value of the chi-square...
The following table contains observed frequencies for a sample of 200. Column Variable Row Variable A...
The following table contains observed frequencies for a sample of 200. Column Variable Row Variable A B C P 40 48 45 Q 10 22 35 Test for independence of the row and column variables using a=.05. Compute the value of the test statistic (to 2 decimals). The -value is - Select your answer -less than .005between .005 and .01between .01 and .025between .025 and .05between .05 and .10greater than .10 What is your conclusion? - Select your answer -Cannot...
The following table contains observed frequencies for a sample of 200. Row Variable Column Variable A...
The following table contains observed frequencies for a sample of 200. Row Variable Column Variable A B C P 16 40 46 Q 34 30 34 Test for independence of the row and column variables using α = 0.05. State the null and alternative hypotheses. H0: Variable P is not independent of variable Q. Ha: Variable P is independent of variable Q. H0: Variable P is independent of variable Q.Ha: Variable P is not independent of variable Q.     H0: The...
The following table contains observed frequencies for a sample of 200.   Column Variable Row Variable A...
The following table contains observed frequencies for a sample of 200.   Column Variable Row Variable A B C P 20 45 50 Q 30 26 29 Test for independence of the row and column variables using  α = .05.   Compute the value of the  Χ 2 test statistic (to 2 decimals).
The following table contains observed frequencies for a sample of 200. Column Variable Row Variable A...
The following table contains observed frequencies for a sample of 200. Column Variable Row Variable A B C P 20 44 50 Q 30 26 30 Test for independence of the row and column variables using a= .05 Compute the value of the  test statistic (to 2 decimals).
A column in your data is missing a value in one row. Which command fills this...
A column in your data is missing a value in one row. Which command fills this missing data point with the value before it? Select an answer: df.fillna(method='bfill') df.fillna(0) df.fillna(method='linear') df.fillna(method='ffill')
Access the CallCenterWaitingTime.xlsx file. Each row in the database corresponds to a different call. The column...
Access the CallCenterWaitingTime.xlsx file. Each row in the database corresponds to a different call. The column variables are as follows: Protocol Type: indicates protocol type, either PT or PE QueueTime: Time in Queue, in seconds Service Time: Service Time, in seconds Perform a test of hypothesis to determine whether the average TiQ is lower than the industry standard of 2.5 minutes (150 seconds). Use a significance level of α=0.05.   Evaluate if the company should allocate more resources to improve its...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT