Ask Question
19 February, 22:33

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. Use separate print statements to print the row and column. Ex: numRows

+2
Answers (1)
  1. 20 February, 00:18
    0
    import java. util. Scanner;

    public class NestedLoops {

    public static void main (String [] args) {

    Scanner scnr = new Scanner (System. in);

    int numRows;

    int numColumns;

    int currentRow;

    int currentColumn;

    char currentColumnLetter;

    numRows = scnr. nextInt ();

    numColumns = scnr. nextInt ();

    for (currentRow = 0; currentRow < numRows; currentRow++) {

    currentColumnLetter = 'A';

    for (currentColumn = 0; currentColumn < numColumns; currentColumn++) {

    System. out. print (currentRow + 1);

    System. out. print (currentColumnLetter + " ");

    currentColumnLetter++;

    }

    }

    System. out. println ("");

    }

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “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 ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers