Ask Question
2 April, 06:05

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

+1
Answers (1)
  1. 2 April, 09:19
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers