Write the prototype for a function named showSeatingChart that will accept the following two-dimensional array as an argument. const int ROWS = 20; const int COLS = 40; string seatingChart[ROWS][COLS]; Note: The two-dimensional array argument must be a const string array. You must include a second integer argument (scalar, not an array).

Answers

Answer 1
Answer:

Answer:

See explaination

Explanation:

void showSeatingChart(string seatingChart[20][40], const int ROWS, const int COLS){

for(int i = 0;i<ROWS;i++){

for(int j = 0;j<COLS;j++){

cout<<seatingChart[i][j]<<" ";

}

cout<<endl;

}

}


Related Questions

An analyst receives an alert from the SIEM showing an IP address that does not belong to the assigned network can be seen sending packets to the wrong gateway. Which of the following network devices is misconfigured and which of the following should be done to remediate the issue? A. Firewall; implement an ACL on the interface B. Router; place the correct subnet on the interface C. Switch; modify the access port to trunk port D. Proxy; add the correct transparent interface
In cell B13, create a formula without a function using absolute references that subtracts the values of cells B5 andB7 from cell B6 and then multiples the result by cell B8. please help with excel!! I'm so lost
Consider the following class definition.public class Tester{privtae int num1;private int num2;/missing constructor /}The following statement appears in a method in a class other than Tester. It is intended t o create a new Tester object t with its attributes set to 10 and 20.Tester t = new Tester(10,20);Which can be used to replace / missing constructor / so that the object t is correctly created?
Write a program segment that simulates flipping a coin 25 times by generating and displaying 25 random integers, each of which is either 1 or 2
How can volunteering yo help plan fundraiser for your team or club be a way to develop your strengths?

Is there a point where preto distribution really takes over?

Answers

Answer:

Yes Preto distribution takes over when we apply 80/20 rule.

Explanation:

The Pareto distribution is derived from pareto principle which is based on 80/20 rule. This is main idea behind the Pareto distribution that  percent of wealth is owned by 20% of population. This 80/20 rule is gaining significance in business world. There it becomes easy to understand the input and output ratio. The input ratio helps to analyse the potential output using Pareto distribution.

Implement a java program to find the smallest distance between two neighbouring numbers in an array.

Answers

Answer:

Here is the JAVA program to find smallest distance between 2 neighboring numbers in an array.

import java.lang.Math; // for importing Math class functions

import java.util.Scanner; // for importing Scanner class

public class CalSmallestDistance // class to calculate smallest distance

{public static void main(String[] args) {     // to enter java program

    Scanner s = new Scanner(System.in);  //creating scanner object

    int size; // size of the array

  System.out.print("Enter size of the array:"); //prompts to enter array size

       size = s.nextInt(); // reads input

       int arr[] = new int[size];  // array named arr[]

      //line below prompts to enter elements in the array             System.out.println("Enter numbers in the array:");

       for(int j = 0; j < size; j++)        //loops through the array

           {arr[j] = s.nextInt(); }     //reads the input elements

      int smallest_distance = Math.abs(arr[0]-arr[1]);  

       int position= 0; //index of the array

       for(int i=1; i<arr.length-1; i++){

           int distance= Math.abs(arr[i]-arr[i+1]);

           if(distance< smallest_distance){

           smallest_distance= distance;

           position = i;            }        }

  System.out.println("Smallest distance is :"+smallest_distance);

System.out.println("The numbers are  :"+arr[position]+ " and " +arr[position+1]);      } }

Explanation:

I have stated the minor explanation of some basic lines of code as comments in the code given above.

Now i will give the detailed explanation about the working of the main part of the code.

Lets start from here

      int smallest_distance = Math.abs(arr[0]-arr[1]);  

In this statement the array element at 0 index (1st position) and the array element at 1 index (2nd position) of the array are subtracted.

Then i used the math.abs() method here  which gives absolute value

Lets say the distance between 3 and 5 is -2 as 3-5 equals to -2. But the math.abs() method will return 2 instead of -2.

Now the subtraction of two array elements and absolute value (if subtraction result is negative) will be assigned to variable smallest_distance.

       for(int i=1; i<arr.length-1; i++)

This is for loop. Variable i is positioned to the 1 index of the array (arr) (it is pointing to the second element of the array). It will move through the array until the end of the array is reached i.e. the loop will continue till value of i remains less than the length of the array.

Now at the start of the loop body the following statement is encountered

           int distance= Math.abs(arr[i]-arr[i+1]);

This subtracts the array element at i th position and array element at i th +1 position (means one position ahead of array element at i th position). In simple words two neighboring numbers in an array are being subtracted and Math.abs() method is used to give absolute value. The result of this operation is assigned to distance variable.

           if(distance< smallest_distance)

This if statement checks if the value in distance variable is smallest than the value of smallest_distance variable which was previously calculated before calculating the value for distance variable.

If this condition is true then the following statements are executed:

             smallest_distance= distance;

if distance value is less than value in smallest_distance, then the value of distance is assigned to smallest_distance.

this means the smallest_distance will keep on storing the smallest distance between two neighboring numbers.

Next the value of variable i that is pointing to the 1st index of the array is now assigned to the position variable.

                                         position = i;

It will keep assigning the value of i to position variable so at the end of the program we can get the positions of the two neighboring numbers that have the smallest distance between them.

Then the value of i is incremented and moves one place ahead in the array.

Then the 2nd iteration takes place and again checks if i pointer variable has reached the end of the array. If not the loop body will continue to execute in which the distance between the two neighboring numbers is calculated and shortest distance is stored in smallest_distance.

When i reaches the end of the array the loop will break and the smallest distance between two neighboring numbers in the array have been stored in the smallest_distance variable.

Finally the statement System.out.println("Smallest distance is :"+smallest_distance); displays the shortest distance and the statement System.out.println("The numbers are  :"+arr[position]+ " and " +arr[position+1]); displays the array index positions at which the two neighboring numbers have the smallest distance.

Given the acquisition environment and circumstances described in the BSVD Program documents, do you recommend contracting without providing for full and open competition for the BSVD bio-sensor contract? Preface your response with either of the following: "Yes, we recommend contracting without providing for full and open competition" or "No, we do not recommend contracting without providing for full and open competition." Note: References to the specific FAR exceptions to full and open competition are not necessary, as these will be addressed in question 2(b). Focus your response on the facts presented in the case and what you find appropriate in relation to conducting full and open competition or limiting competition. Provide at least three facts from the case that support your rationale and explain how these facts lead to your conclusion.

Answers

Answer:

No, we do not recommend contracting without providing for full and open competition. There is sufficient evidence that the necessary BSVD is only available from the original source, NanoTech, and that use of any other contractor would create unacceptable delays in fulfilling the need.

What information is required for a complete citation of a website source?A: the title, volume number, and page numbers
B: the responsible person or organization and the website URL
C: the responsible person or organization, date accessed, and URL
D: the responsible person or organization and the date accessed

Answers

Answer:

C: the responsible person or organization, date accessed, and URL

Explanation:

Problem 1 (10%): You are asked to design a database for an auto-shop that satisfies the following requirements: a. Each customer has a unique customer identification number, a name, address, day time telephone number, evening telephone number. The customer name includes first name, middle initial and last name. The address includes street address, city, state, and zip code. The telephone numbers include area code and the number. b. Each car type has a unique type name, the make, model, and year of make. c. The car has a unique license number, a car type, color, type of transmission, and the customer who brings the car to the auto-shop. d. The database keeps records of repairs. The repair record includes the date of the repair, the car that the repair was done, the name of the engineer who did the repair, and the cost of the repair.

Answers

Answer:

see explaination

Explanation:

I am considering some relationship for this ER Diagram as follows :

(i) One Car can have only one type.

(ii) One Car needs more than one repairings.

(iii) A customer can have more than one car and a car must belong to only one customer.

Suppose that a queue is implemented using a circular array of size 12. What is the value of last after the following operations?10 enqueue operations
5 dequeue operations
6 enqueue operations
10 dequeue operations
8 enqueue operations
2 dequeue operations
3 enqueue operations
Last = 10

Answers

Answer:

10

Explanation:

An enqueue operation is a function that adds an element(value) to a queue array. A dequeue operations removes an element from a queue array. Queue arrays follow a first-in-first-out approach, so elements that are first stored in the queue are removed/accessed first(enqueue operations add elements at the rear of the queue array).

The following operations leave 10 elements in the queue of array size 12 after its done:

10 enqueue operations= adds 10 elements

5 dequeue operations= removes 5 elements( 5 elements left in queue)

6 enqueue operations= adds 6 elements(11 elements in queue)

10 dequeue operations= removes 10 elements(1 element left in queue)

8 enqueue operations= adds 8 elements(9 elements in queue)

2 dequeue operations= removes 2 elements(7 elements left in queue)

3 enqueue operations= adds 3 elements(10 elements in queue)

Therefore there are 10 elements in the queue after enqueue and dequeue operations.