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
krok68 [10]
3 years ago
8

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

1A 1B 1C 2A 2B 2C
Computers and Technology
1 answer:
nata0808 [166]3 years ago
4 0

Answer:

Following are the program for the above question in python:

Explanation:

def seat(num_rows,num_cols):#function definition.

   for x in range(1,num_rows+1):#first for loop.

       c='A'

       for y in range(1,num_cols+1): #second for loop.

           print(str(x)+c,end=" ") #print the value

           c=chr(ord(c)+1) #expression to form a charater addition.

seat(int(input("enter the number of rows: ")),int(input("enter the number of columns: "))) #take the input from the user.

Output:

  • If the user inputs 2 and 3, then the output is :"1A 1B 1C 2A 2B 2C 3A 3B 3C 4A 4B 4C".

Code Explanation :

  • The above code is in python language, in which the first line is used to render a message to the user then take the inputs from the user and then pass to the function after converting into int function.
  • Then there are two loops in the function which are used to print the number of the seat.
  • The first loop is used to print the row number and the second loop is used to print the column number.
You might be interested in
Think about a career you would like to have 10 years from now.
WITCHER [35]

Answer: Scientist

Explanation: Scientists use technology to record data, as well as using technology to study different things, for example scientists use computers to track DNA.

6 0
2 years ago
Please read !!!
prisoha [69]
Don’t stress. You’re no failure if you believe in yourself. Have some faith. Don’t give up and live your life to the fullest. Take care and stay safe!! :)
3 0
3 years ago
Insert a formula that references the appropriate worksheets in cell a3 on the offensive totals worksheet to calculate total pass
Mnenie [13.5K]

In excel spreadsheets, you need to consider specifying relationships between the information you have stored in your spreadsheets when creating formulas. The elements that will help you understand using spreadsheet are the constants, operators, references and functions. This will enable you to use the formulas, without hassle in spreadsheets.

3 0
3 years ago
What is the main goal of computer generated by digitalization
mars1129 [50]

Answer:

for better future and attractive human life

4 0
3 years ago
Define a function SetTime, with int parameters hoursVal and minutesVal, that returns a struct of type TimeHrMin. The function sh
Lapatulllka [165]

Answer:

#include <stdio.h>

typedef struct TimeHrMin_struct //struct

{

int hours;

int minutes;

} TimeHrMin;

struct TimeHrMin_struct SetTime(int hoursVal,int minutesVal) //SetTime function

{

struct TimeHrMin_struct str;

str.hours=hoursVal; //assigning the values

str.minutes=minutesVal;

return str; //returning the struct

}

int main(void)

{

TimeHrMin studentLateness;

int hours;

int minutes;

scanf("%d %d", &hours, &minutes);

studentLateness = SetTime(hours, minutes); //calling the function

printf("The student is %d hours and %d minutes late.\n", studentLateness.hours, studentLateness.minutes);

return 0;

}

Explanation:

4 0
3 years ago
Other questions:
  • The length of a hailstone sequence is the number of terms it contains. For example, the hailstone sequence in example 1 (5, 16,
    9·1 answer
  • Checking tire pressure should be performed:
    11·2 answers
  • Grace Hopper led the development of ______, a programming language for business applications.
    6·2 answers
  • A technician has just installed a video card in a PC. The video card is not working, althoughit was working fine on the test ben
    6·1 answer
  • What is earning potential?
    10·1 answer
  • What is a URI (include example)
    7·1 answer
  • Cómo se llaman los robots que se utilizan para la exploración espacial, en medicina, en la industria, en la agricultura, los que
    13·1 answer
  • Refer to the image on the right. Then, using the drop-down menu, identify the correct printer type. A: inexpensive home printer
    10·1 answer
  • When an organizatin needs a program to do a very specific job, it mayhire someone to write _____ software.​
    10·1 answer
  • Colours can be contrasting if<br>​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!