Ask 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 after each seat, including after the last. Use separate print statements to print the row and column. Ex: numRows

+3
Answers (1)
  1. 3 July, 18:07
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers