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
docker41 [41]
3 years ago
10

In Java; 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 and numColumns = 3 prints:1A 1B 1C 2A 2B 2C 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();numColumns = currentColumnLetterfor(currentRow = 0; currentRow < numRows;currentRow++){for(currentColumn = =System.out.println("");}}
Computers and Technology
1 answer:
gtnhenbr [62]3 years ago
4 0

Answer:

The solution code is written in Java.

  1. import java.util.Scanner;
  2. public class Main {
  3.    public static void main(String[] args) {
  4.        String letters[] = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J"};
  5.        Scanner scnr = new Scanner(System.in);
  6.        int numRows;
  7.        int numColumns;
  8.        int currentRow;
  9.        int currentColumn;
  10.        numRows = scnr.nextInt();
  11.        numColumns = scnr.nextInt();
  12.        for(currentRow = 0; currentRow < numRows;currentRow++){
  13.            for(currentColumn =0; currentColumn < numColumns; currentColumn++)
  14.            {
  15.                System.out.print((currentRow + 1) + letters[currentColumn] + " ");
  16.            }
  17.        }
  18.    }
  19. }

Explanation:

Firstly, we need to create an array to hold a list of letters (Line 6). In this solution, only letters A - J are given for simplicity.

Next, we declare all the variables that we need, numRows, numColumns, currentRow and currentColumn (Line 8 - 11).

Next, we use Scanner object, scnr to prompt user to input integer for <em>numRows </em>and <em>numColumns </em>(Line 12-13).

At last, we use two-layer for loops to traverse through the number of rows and columns and print out the currentRow and currentColumn (Line 15-19). Please note the currentRow is added by 1 as the currentRow started with 0. To print the letter, we use currentColumn as an index to take out the letter from the array.

You might be interested in
Who invented the Graphical User Interface (GUI)?
GaryK [48]

Xerox PARC by Alan Kay, Douglas Engelbart, and a group of other researchers in 1981.

3 0
4 years ago
What is machine learning
Katyanochek1 [597]

Answer:

machine learning is the ability for computers to develop new skills and algorithms without specific instructions to do so.

5 0
3 years ago
Read 2 more answers
What's a qat on a computer
suter [353]
The answer is ..........

The Microsoft Quick Access Toolbar (QAT<span>) is a toolbar menu that appears in Microsoft Excel, Microsoft Word, and other Office 2007 and above products in the top left corner of the window. As seen in the picture, the Quick Access Toolbar gives you quick access to commonly used features such as the Save feature.
</span>
hope it helps have a great one! :)
5 0
3 years ago
Read 2 more answers
When assembling a desktop computer you should always install the drives before the motherboard?
s2008m [1.1K]
Yes you should install drives first
8 0
3 years ago
no one can succeed in his or her career without relying on others for help or opportunities. It’s best, though,
fenix001 [56]

idk good luck man idek if this is a question but if it is just go with c or b

3 0
3 years ago
Other questions:
  • A switch operates in the OSI reference model __________ layer and uses the __________ address to forward packets.
    8·1 answer
  • How have search engines like Google, Bing, and Yahoo! revolutionized the ability to do research? They are more difficult to acce
    15·2 answers
  • Selecting the option to control Widows and Orphans will prevent _________. A single line from appearing at the top or bottom of
    10·1 answer
  • PLEASE HELP<br><br><br> i’m doing a internet safety brochure. what is a good hook ?!
    14·1 answer
  • Which of the following is an example of a formal business standard
    14·2 answers
  • Why is it important to respect other political opinions
    7·2 answers
  • John is runnig his Database application on a single server with 24 Gigabytes of memory and 4 processors. The system is running s
    6·1 answer
  • Complete the sentence about entering and editing data in a cell in a spreadsheet.
    13·1 answer
  • The information given to you by your teachers is always accurate and should never be questioned. Please select the best answer f
    8·1 answer
  • A natural language processor comes across a sentence that contains the word “weightless.” The morphology component identifies th
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!