1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Andrew [12]
3 years ago
11

Checkpoint 7.61 Write the prototype for a function named showSeatingChart that will accept the following two-dimensional array a

s 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).
Computers and Technology
2 answers:
Kobotan [32]3 years ago
7 0

Answer:

void showSeatingChart(const string [][COLS], int);

Explanation:

void showSeatingChart(const string [][COLS], int);

The above function showSeatingChart() will display the 2D array of seating chart.

The return type of this function is void because it does not need to retun anything.

The parameter of the function is a 2D array which is seatingChart[ROWS][COLS].

The type of this 2D array is string that means it is a 2D array of string. It will contain string elements.

To declare a prototype of a function, there should be a semi-colon (;) at the end of declaration.

The definition of the function should be given outside main() function and declaration of the function should be above the main() function or at the beginning of the program with declaration of constant variables.

New2This2 years ago
0 0

void showSeatingChart(const string [][COLS], int);

You might be interested in
Ana is a music lover. She loves to download songs and videos on her computer every time she hears a new song. One day, her compu
o-na [289]

Answer:

Storage outage

As many new songs are released to the Internet every day, Anna might have download thousands of them, which made her computer ran out of storage and RAM(random access memory )

5 0
2 years ago
A list of the slides in a presentation is found here.
Hoochie [10]
 Formatting toolbar because if you look to the right there is the slides and at the top it says: Formatting toolbar
8 0
3 years ago
Read 2 more answers
The Zootopia Police Department is recruiting new officers and has come up with an innovative equation to hire. They define hireS
Dahasolnce [82]

Answer:

#include<iostream>

#include<limits>

#include<iomanip>

using namespace std;

//function that returns true

//if there is invalid input like giving string as input

// for integer value.

bool isInvalidInput()

{

  //return true if cin.fail

  if(cin.fail())

  {

      //clear the buffer

      cin.clear();

      cin.ignore(numeric_limits<streamsize>::max(),'\n');

      return true;

  }

  return false;

}

//function that calculates the hire score for given 3 parameters.

double calHireScore(double agility,double strength,double speed)

{

  return (1.8*agility) + (2.16 * strength) + (3.24 * speed);

}

//calculate hire score for fox.

void calFoxHireScore()

{

  double agility,strength;

 

  cout<<"Enter Agility Value: ";

  //get agility as input and validate it.

  cin >> agility;

  if(isInvalidInput() || agility <= 0)

  {

      cout<<"\nError: Agility value must be > 0"<<endl;

      return;

  }

 

  cout<<"Enter Strength Value: ";

  cin >> strength;

  if(isInvalidInput() || strength <= 0)

  {

      cout<<"\nError: Strength value must be > 0"<<endl;

      return;

  }

 

  cout<<"\nHire Score for Fox: "<<calHireScore(agility,strength,0)<<endl;

}

//function that asks input from user for

//calculating hire score for Sloth.

void calSlothHireScore()

{

  double strength,speed;

 

  cout<<"Enter Strength Value: ";

  cin >> strength;

  if(isInvalidInput() || strength <= 0)

  {

      cout<<"\nError: Strength value must be > 0"<<endl;

      return;

  }

 

  cout<<"Enter Speed Value: ";

  cin >> speed;

  if(isInvalidInput() || speed <= 0)

  {

      cout<<"\nError: Speed value must be > 0"<<endl;

      return;

  }

 

  cout<<"\nHire Score for Sloth: "<<calHireScore(0,strength,speed)<<endl;

}

//function that asks input from user for

//calculating hire score for Bunny.

void calBunnyHireScore()

{

  double agility,speed;

 

  cout<<"Enter Agility Value: ";

  cin >> agility;

  if(isInvalidInput() || agility <= 0)

  {

      cout<<"\nError: Agility value must be > 0"<<endl;

      return;

  }

 

  cout<<"Enter Speed Value: ";

  cin >> speed;

  if(isInvalidInput() || speed <= 0)

  {

      cout<<"\nError: Speed value must be > 0"<<endl;

      return;

  }

 

  cout<<"\nHire Score for Bunny: "<<calHireScore(agility,0,speed)<<endl;

}

//function to display menu for user.

void menu()

{

  cout<<"\n1. Fox"<<endl;

  cout<<"2. Bunny"<<endl;

  cout<<"3. Sloth"<<endl;

  cout<<"0. Quit"<<endl;

  cout<<"Enter your choice: ";

}

//main method

int main()

{

  int choice;

  do

  {

      //asks choice

      menu();

      cin >> choice;

      //if invalid input print erro message

      if(isInvalidInput())

      {

          cout<<"\nError: Invalid choice enetered. Try Again\n";

      }

      else

      {

          cout<<"\n";

          //if any one of the choices do accordingly

          //for invalid choice print error mesage.

          switch(choice)

          {

              case 1:

                  calFoxHireScore();

                  break;

              case 2:

                  calBunnyHireScore();

                  break;

              case 3:

                  calSlothHireScore();

                  break;

              case 0:

                  cout<<"\nQutting...\n";

                  break;

              default:

                  cout<<"Invalid choice entered."<<endl;

                  break;

          }

      }

     

  }while(choice != 0);

 

  return 0;

}

Explanation:

3 0
3 years ago
Write a C++ program that prompt the user to enter three points (x1, y1), (x2, y2), (x3,y3) of a triangle and displays its area.
maxonik [38]

Answer:

Here is the code in c++.

//include headers

#include <bits/stdc++.h>

using namespace std;

//main function

int main() {

//variables to store coordinates

float x1,x2,y1,y2,x3,y3;

cout<<"Please Enter the coordinate of first point (x1,y1): ";

// reading coordinate of first point

cin>>x1>>y1;

cout<<"Please Enter the coordinate of second point (x2,y2): ";

// reading coordinate of second point

cin>>x2>>y2;

cout<<"Please Enter the coordinate of third point (x3,y3): ";

// reading coordinate of third point

cin>>x3>>y3;

//calculating area of the triangle

float area=abs((x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))/2);

cout<<"area of the triangle:"<<area<<endl;

return 0;

}

Explanation:

Declare four variables x1,x2,x3,y1,y2,y3 to store the coordinate of all three

points of circle.Read the coordinate of all the point from user.Calculate area of triangle with the help of mentioned formula area=abs((x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))/2). Then print the area of the triangle.

Output:

Please Enter the coordinate of first point (x1,y1): 11 17                                                                                                      

Please Enter the coordinate of second point (x2,y2): 23 30                                                                                                    

Please Enter the coordinate of third point (x3,y3): 43 18                                                                                                      

area of the triangle:202  

5 0
3 years ago
The use of digital technology in medicine is constantly evolving.
otez555 [7]

Answer:

Digital technology is easy to understand once you know how to properly use it.

Explanation:

3 0
2 years ago
Other questions:
  • In this type of network, data is certain to reach its destination.
    7·1 answer
  • Philip is thinking about customizing his motorcycle. A paint job, saddlebags, and a radio would cost $600. His motorcycle is old
    15·2 answers
  • Tim has an old server computer that his company uses as a backup. One of the hard drives has gone bad and needs to be replaced.
    13·1 answer
  • At the coffee shop where they work, Jen is the safety officer, Richard is in charge of administering first aid, Ashley is respon
    13·2 answers
  • 3.24 LAB: Seasons
    13·1 answer
  • Assume that the int variables i and j have been declared, and that n has been declared and initialized.
    10·1 answer
  • What are the most commonly found items in the trash according to the Municipal Solid Waste report?
    12·2 answers
  • What is the next line?
    7·1 answer
  • Creating a Numpy Array
    5·1 answer
  • You're doing desktop support and the company policy is that you can only help with company equipment. A user walks in:
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!