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
URGENT!
lutik1710 [3]

<u>Explanation:</u>

Hey there! you need not to panic about it ,your program didn't have Driver program i.e main program! the correct & working code is given below:

// C++ program to count  even digits  in a given number .

#include <iostream>  

using namespace std;  

// Function to count digits

int countEven(int n)  

{  

int even_count = 0;    

while (n > 0)  

{  

 int rem = n % 10;  

 if (rem % 2 == 0)  

  even_count++;  

 n = n / 10;  

}  

cout << "Even count : "

 << even_count;  

if (even_count % 2 == 0 )  

 return 1;  

else

 return 0;  

}  

// Driver Code  

int main()  

{  

int n;  

std::cin >>n;

int t = countEven(n);  

return 0;  

}  

6 0
2 years ago
Miriam Is a network administrator. A few employees want to access sensitive Information stored on a backup device. She wants to
mihalych1998 [28]

Answer:

C. user accounts

Explanation:

An access control can be defined as a security technique use for determining whether an individual has the minimum requirements or credentials to access or view resources on a computer by ensuring that they are who they claim to be.

Simply stated, access control is the process of verifying the identity of an individual or electronic device. Authentication work based on the principle (framework) of matching an incoming request from a user or electronic device to a set of uniquely defined credentials.

Basically, authentication and authorization is used in access control, to ensure a user is truly who he or she claims to be, as well as confirm that an electronic device is valid through the process of verification

Hence, an access control list primarily is composed of a set of permissions and operations associated with a NTFS file such as full control, read only, write, read and execute and modify.

Generally, access control list are defined for specific user accounts and may either be an administrator, standard user or guest account.

In this scenario, Miriam a network administrator wants to give access rights to employees who are interested in accessing sensitive Information stored on a backup device. Thus, the option Miriam should use is user account.

7 0
2 years ago
Why the computer is known as versatile and diligent device ? explain.<br>​
Scrat [10]

Answer:

Computer is called versatile and diligent device because it is used in almost all the fields for various purposes and it can perform the task repeatedly without loosing its speed and accuracy for long time.

5 0
1 year ago
Write down eight points on how modern technology have effected our life ?
luda_lava [24]

Answer:

  1. Made everyday activities easy to do
  2. We have become dependant on mordern technology
  3. We use the internet for everything
  4. Meetings can be done online
  5. food can be ordered and delivered online
  6. Payments can be done using technology
  7. We pay more attention to social media
  8. Meet new people online
3 0
2 years ago
Why are digital signals an accurate and reliable way to record and send information?
Oduvanchick [21]

Answer:

A wave that has been digitized can be played back as a wave over and over, and it will be the same every time. For that reason, digital signals are a very reliable way to record information—as long as the numbers in the digital signal don’t change, the information can be reproduced exactly over and over again.

Explanation:

6 0
2 years ago
Other questions:
  • What are personal skills? A manner of individual style How a person manages and expresses oneself One's ability to excel at spor
    13·2 answers
  • . char values are surrounded by _____ quotes
    15·1 answer
  • The purpose of a lockout tagout checklist is to​
    9·2 answers
  • Analytical processing uses multi-levelaggregates, instead of record level access.? True? False
    12·1 answer
  • Level of comfort that people feel
    10·1 answer
  • Which type of microscope can only be used to view non-living specimens?
    10·2 answers
  • Describe three perimeter intrusion detection systems and give an example of one that you have seen deployed either at work or an
    8·1 answer
  • Which of the following is an example of phishing attack? csp
    8·1 answer
  • 1.The hardware that allows data to be transmitted from a computer along a telephone line to another computer at the other end is
    12·1 answer
  • What are the functions of super computer?<br> ​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!