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]
3 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]3 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
Dominick has been hired to design a network for Pirate Press. In a paragraph of no less than 125 words, discuss what he needs to
Luda [366]
If Dominic is to design a network for Pirate Press he would have to consider and know of the following:
a. Growing capital - he needs to know if the company's sales is growing or is in debt so that he would know what course of action he could take in case he pursues projects for the company. 
b. People/Team - the people/team working are the heart and soul of any company and knowing their specific needs and how they work is key to knowing how the company works as one unit 
c. Marketing of the product - he needs to know how the product sells in order for him to decide what other strategies he can incorporate to make the product more marketable to people.

3 0
3 years ago
Read 2 more answers
The term digital divide refers to "the gap between people with effective access to digital and information technology and those
skad [1K]

Answer:

Factors Influencing Unequal Internet Access:

1. Age: Children under 10 and adults over 60 do not enjoy the same level of access to the internet.  For children 10, their parents restrict their use of the internet.  Most adults over 60 lack the interest and competence to utilize access to the internet.

2. Sex: Men usually enjoy better access to the internet than women.  While men explore many sources of internet information, women usually restrict themselves to social media, which is usually their favorites, giving the high-level chatting that is involved in social media.

3. Nationality:  Access to the internet is not available equally in all the nations of the world.  In communist China, there are government-mandated restrictions placed on citizens.  In some sub-Saharan African countries, access to the internet is a luxury that many cannot afford and it is not easily available due to lack of basic internet infrastructure.

4. Education is another factor that influences access to the internet.  The level of education dictates whether somebody has access or not.  Many illiterate men and women who do not value the internet.  What you do not value, you do not use.  What you do not use is not accessible to you.

5. Income:  This is another important factor that influences access to the internet.  In some countries, the availability of high-speed network remains unaffordable to the majority of the population.  They only have telephone networks to use their internet access, due to the high cost of high-speed digital satellite-based networks.  Many people can only access the internet on public WiFis.

Explanation:

According to wikipedia.com, "Internet access is the ability of individuals and organizations to connect to the Internet using computer terminals, computers, and other devices; and to access services such as email and the World Wide Web."

8 0
4 years ago
. simulation programs can use a range of integer values to mimic variability in the simulation. a. true b. false
RSB [31]

True, simulation programs can use a range of integer values to mimic variability in the simulation.

What are simulation programs ?

The foundation of simulation software is the process of simulating a genuine phenomena using a set of mathematical equations. In essence, it's a program that enables the user to simulate a process while still observing it in action.
It is theoretically possible to simulate on a computer any phenomenon that can be reduced to numerical values and equations.
Identifying the most crucial elements that have an impact on the simulation's objectives is one of the tricks to creating useful simulations.

Therefore, simulation programs can use a range of integer values to mimic variability in the simulation.

You can learn more about simulation programs from the given link:

brainly.com/question/27159343

#SPJ4

5 0
2 years ago
Users on the networks connected to the R1 router report that they are unable to contact computers connected to the R3 router. Tr
melisa1 [442]

Answer:

On R3, run OSPF for area 0 on Fa0/0

On R3, run OSPF for area 0 on Fa0/1

Then,

On R3, run OSPF for area 0 on serial0/1/0.

Explanation:

Open Shortest Path First (OSPF) is a routing protocol for Internet Protocol (IP) networks. You then use a link state routing (LSR) algorithm and falls into the group of interior gateway protocols (IGPs), operating within a single autonomous system (AS).

3 0
3 years ago
The line cord of a vacuum cleaner must be of the A. Cotton-covered type. B. Jacketed type. C. Grounded type. D. Zip type.
Margarita [4]

Answer: c

Explanation: to be honest I guessed

I mean aren't cords usually laying on the ground

6 0
3 years ago
Read 2 more answers
Other questions:
  • What are ways to switch windows in Excel? Check all that apply. On the status bar, click the Windows button, and then click the
    9·1 answer
  • Identify the characteristics of logic problems.select all that apply
    5·1 answer
  • The master production schedule for Product A shows a need for 30 units, and Product B shows a need of 25 units. To manufacture a
    12·1 answer
  • Is phone data used when connected to wifi
    12·1 answer
  • Virtual classrooms are examples of communication or not​
    5·2 answers
  • What makes manually cleaning data challenging?
    15·1 answer
  • If i hit the delete key three times what will be left
    12·1 answer
  • PLEASEEE HELPPP im gonna cry
    11·2 answers
  • 3. List three common vector image file types.
    7·1 answer
  • What are point to consider while running occupation?​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!