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
KengaRu [80]
2 years ago
14

Given numRows and numColumns, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print

a space after each seat, including after the last. Ex: numRows = 2 and numColumns = 3 prints: 1A 1B 1C 2A 2B 2C

Computers and Technology
1 answer:
yawa3891 [41]2 years ago
6 0

Answer:

Step by step explanation along with code and output is provided below.

Explanation:

// the outer loop is for printing digits starting from 1 to numRows

// the inner loop is for printing letters starting from 'A' to numCols

//  char cols = 'A';   should not be inside inner loop or outside outer loop, in both these cases char either repeats itself or continues in a sequence. Therefore it must be inside of outer loop

//  int rows = 1;  ensures that row starts at 1

#include <iostream>

using namespace std;

int main()

{

int numRows;

int numCols;

int rows = 1;

cout <<"Enter number of Rows"<<endl;

cin>>numRows;

cout <<"Enter number of Columns"<<endl;

cin>>numCols;

cout<<"Seats in the theater are:"<<endl;

for(int i = 0; i < numRows; i++)

{

  char cols = 'A';  

 for(int j = 0; j < numCols; j++)

 {

  cout <<rows << cols << " ";

  cols= cols + 1;

 }

 rows= rows + 1;

}

  return 0;

}

Output:

When Rows = 2 and Columns = 3

Enter number of Rows

2

Enter number of Columns

3

Seats in the theater are:

1A 1B 1C 2A 2B 2C

When Rows = 4 and Columns = 5

Enter number of Rows

4

Enter number of Columns

5

Seats in the theater are:

1A 1B 1C 1D 1E 2A 2B 2C 2D 2E 3A 3B 3C 3D 3E 4A 4B 4C 4D 4E

Hence program is working correctly for any number of rows and columns

You might be interested in
What does nntp stand for?
Ber [7]
<span>Nntp is Network News Transfer Protocol </span>
5 0
3 years ago
Read 2 more answers
What is bug in computer?​
Anton [14]

Answer:

<h2>A bug in a computer is refered to as a "computer virus" its where certain things on the computer or apps on it aren't working like they were designed to. </h2>

Explanation:

<h2>Hope this helps:)!</h2>
6 0
2 years ago
Question 4 (2 points)
rodikova [14]

Answer:

Add the broadcast jump! code to the end of Scratch Cat's code.

Explanation:

If we broadcast the jump! code, then the Gobo will listen, and he will start jumping up and down. It looks like that he is not getting what Scratch Cat is saying, and if the message of Scratch Cat is broadcasted then Gobo will listen to what Scratch Cat is telling. Hence, the above option is the correct option.

6 0
3 years ago
Read 2 more answers
Select all examples of proper keyboarding technique.
emmasim [6.3K]
Keep your eyes on the text and aim to make no mistakes
4 0
3 years ago
Read 2 more answers
Smart art can be used to create that highlight relationships between two items
Allisa [31]

Answer:

The answer to this question is given below in this explanation section.

Explanation:

A smart Art graphic is a visual representation of your information and ideas.you create one by choosing a layout this fits your message.Some layouts specific kind of information,while other simply enhance the appearance of a bulleted list.

    You can create a smart graphic in excel power point,word,or in an email message in outlook.The smart button is one the insert tab and developing on your screen size,may look like.

Other office program do not allow for smart art art graphic creation,but you can copy and paste smart graphics as image into those programs.As part of this process,when you are prompted to choose a type such as process hierarchy,or relationship.A type is similar to a category of smart art graphic,and each type contains several different layouts.

Because you can quickly and easily switch layouts,try different layouts until you find the one that best illustrate your message.

7 0
2 years ago
Other questions:
  • Which statement describes the word "iterative"?
    9·1 answer
  • Siva added a "Contact Form" to her website.
    10·1 answer
  • Proper numeric keyboarding technique includes:
    15·1 answer
  • What can act as a buffer against unemployment
    11·1 answer
  • 1. Which of the following is not related to a buffer overflow? A. Static buffer overflow B. Index error C. Canonicalization erro
    10·1 answer
  • Read the following example cover letter: To Ms. March: I was excited to see your opening for a customer support specialist with
    13·1 answer
  • How do you get a crown on this website<br> look under your points on the right side of your picture
    15·2 answers
  • Premise: Tracy has a file that contains a list of actors and the movies in which they acted. She wants to know the top 3 ranked
    8·1 answer
  • SNMP is a protocol used to query hosts, servers, and devices about performance or health status data. This protocol has long bee
    7·1 answer
  • TECHNICAL TERMS: the adderess of a website
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!