answer.
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
Ket [755]
2 years ago
14

Given num_rows and num_cols, 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. Sample output with inputs: 2 3
Engineering
1 answer:
Lisa [10]2 years ago
8 0

Answer:

The solution code is written in Python:

  1. alphabets = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
  2. user_input = input("Enter row and columns: ")
  3. myArr = user_input.split(" ")  
  4. num_rows = int(myArr[0])
  5. num_cols = int(myArr[1])
  6. seats = []
  7. for i in range(num_rows):
  8.    row = []
  9.    for j in range(num_cols):  
  10.        row.append(alphabets[j])
  11.    
  12.    seats.append(row)
  13. output = ""
  14. for i in range(len(seats)):
  15.    for j in range(len(seats[i])):
  16.        output += str(i + 1) + seats[i][j] + " "  
  17. print(output)

Explanation:

Firstly, we define a short alphabets list from A - J (Line 1).

Next, we prompt user to input row and columns (Line 3). Since the input is a string (e.g. "2 3"), we need to use split() method to separate the individual row and column number as individual element in a list (Line 4). We assign the first element (row number) to variable<em> num_rows</em> and second element (column number) to variable <em>num_cols</em>.

Next, we generate the seats list by using a two-layers for-loop (Line 10 -15). After the seat list is ready, we use another two-layers for-loop to generate output string as required by the question (Line 19-21).

At last, we print the output (Line 23). A sample input of 2 3 will generate the output as follows:

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

You might be interested in
Reconsider Couette flow between two parallel plates as derived in class, but with the top plate moving with a known velocity +i
Sloan [31]

Answer:

Go through the solution attached. It is very detailed.

Explanation:

6 0
2 years ago
The gradual and uniform cooling of glass that has been heated in order to relieve random internal stresses is... Group of answer
kirill115 [55]

Answer: Annealing

Explanation:

In the manufacturing of glass, Processes such as expansion when glass heats and cooling when it contracts are involved. These build up random internal stresses which can cause cracks and breakage when finally cooled at room temperature. To relieve these stresses, Annealing is carried out on glass during the manufacturing process.

Annealing is the process whereby the temperature during the process of the manufacturing of glass is reduced and maintained at a uniform rate so that it undergoes a gradual cooling process. so as to make the glass tough and reduce internal stress.

7 0
2 years ago
1. Discuss how products incorporate aesthetic design and why this appeals to target markets 2. Discuss how the universal design
Nikitich [7]

<u>Explanation:</u>

<em>Remember, </em>to say a product is incorporated with aesthetic design implies that its overall appearance is designed to look beautiful to the eyes of the user/buyer. For example, a clothing company whose target market is mainly focused on women's clothing<u> would need to take into consideration that certain colors like pink, blue, etc are attractive to women more than men.</u> So they'll have to ensure the colors of their clothing are suitable to the needs of their target market.

The Universal Design process involves building products that can be used by a wide range of users at ease. For example, you may ask yourself: Is my product/service easily accesible to those with disabilities?

Other processes include;

  • Defining who the users (or universe) are of the products.
  • Involve consumers in the design.
  • Follow the existing standards of product design
  • Evaluate and review your universal design methods
3 0
2 years ago
A spherical hot-air balloon is initially filled with air at 120 kPa and 20°C with an initial diameter of 5 m. Air enters this ba
adoni [48]

Answer:

time is 17.43 min

Explanation:

given data

initial diameter = 5 m

velocity = 3 m/s

final diameter = 17 m

solution

we will apply here change in change in volume equation that is express as

ΔV = \frac{4}{3} \pi * (rf)^3 - \frac{4}{3} \pi * (ri)^3    .............1

here ΔV is change in volume and rf is final radius and ri is initial radius

ΔV = \frac{4}{3} \pi * (8.5)^3 - \frac{4}{3} \pi * (2.5)^3

ΔV = 2507 m³

so

Q = velocity × Area

Q = 3 × π ×(0.5)² = 2.356 m³/s

and

change in time is express as

Δt = \frac{\Delta V}{Q}

Δt = \frac{2507}{2.356}

Δt = 1046 sec

so change in time is 17.43 min

8 0
2 years ago
1. A _____ is applied to a wall or roof rafters to add strength and keep the building straight and plumb.
PSYCHO15rus [73]

Answer:

A force must s applied to a wall or roof rafters to add strength and keep the building straight and plumb

7 0
2 years ago
Other questions:
  • 2.5 kg of air at 150 kPa and 12°C is contained in a gas-tight, frictionless piston-cylinder device. The air is now compressed to
    5·1 answer
  • What is the damped natural frequency (in rad/s) of a second order system whose undamped natural frequency is 25 rad/s and has a
    15·1 answer
  • What statement exemplifies the role of archeology in architecture?
    14·1 answer
  • Problem 8. Define a function gs1_error(n) that accepts as input a non-negative integer n and outputs the error of the Gauss-Seid
    7·1 answer
  • A cylinder in space is of uniform temperature and dissipates 100 Watts. The cylinder diameter is 3" and its height is 12". Assum
    15·1 answer
  • Add an Overflow output to the 32-bit ALU from Exercise 5.9. The output is TRUE when the result of the adder overflows. Otherwise
    12·1 answer
  • A cylindrical rod 100 mm long and having a diameter of 10.0 mm is to be deformed using a tensile load of 27,500 N. It must not e
    6·1 answer
  • A rectangular bar of length L has a slot in the central half of its length. The bar has width b, thickness t, and elastic modulu
    14·2 answers
  • Compare a series circuit powered by six 1.5-volt batteries to a series circuit powered by a single 9-volt battery. Make sure the
    6·1 answer
  • 4.116 The lid of a roof scuttle weighs 75 lb. It is hinged at corners A and B and maintained in the desired position by a rod CD
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!