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
You are the network administrator for a company with a single Active Directory domain. The corporate office is located in Miami
Lubov Fominskaja [6]

Answer: throw your computer out of the window because to hell with this question

Explanation:

4 0
3 years ago
To reduce chances of system failure, engineers may use _____ .
Nataliya [291]
<span>To reduce chances of system failure, engineers may use process control. This is a system which involves activities that ensures the whole process variables can be predicted and controlled to prevent failure. This involves the use of safety valves and sensors.</span>
5 0
3 years ago
Read 2 more answers
PLZ ANSWER ALL MY QUESTION. Which line of code will display the variable num rounded to the nearest tenth?
zavuch27 [327]

Answer:

A

Explanation:

5 0
3 years ago
For two integers m and n, their GCD(Greatest Common Divisor) can be computed by a recursive function. Write a recursive method g
konstantin123 [22]

Answer:

In Python:

def gcd(m,n):

if n == 0:

 return m

elif m == 0:

    return n

else:

 return gcd(n,m%n)

Explanation:

This defines the function

def gcd(m,n):

If n is 0, return m

<em> if n == 0: </em>

<em>  return m </em>

If m is 0, return n

<em> elif m == 0: </em>

<em>     return n </em>

If otherwise, calculate the gcd recursively

<em> else: </em>

<em>  return gcd(n,m%n)</em>

<em />

<em>To call the function to calculate the gcd of say 15 and 5 from main, use:</em>

<em>gcd(15,5)</em>

6 0
3 years ago
A thin film transistor (TFT) is a/an______________.
Leviafan [203]

Answer:

Option a electronic switch used on FPDs

Explanation:

A thin film transistor (TFT) is an electronic switch which is commonly used in a liquid crystal display (LCD). TFT derives its name by the way how it is produced. It is produced by layering thin films of semiconductor.  TFT is a type of transistor which is used to control state every  individual pixel in a LCD. TCT can change the states of pixels (on and off) very quickly.

6 0
3 years ago
Other questions:
  • In gaming, "rendering" refers to:
    12·2 answers
  • Convert to octal. Convert to hexadecimal. Then convert both of your answers todecimal, and verify that they are the same.(a) 111
    12·1 answer
  • True or False <br><br> The term virus and malware may be used interchangeably.
    13·1 answer
  • Chen needs to configure a filter on the current folder and would like to filter by the sender of a message. Which tab in the Fil
    7·2 answers
  • After you configure backup settings using the backup plugin, backup jobs will run automatically and start taking backups at the
    13·1 answer
  • PLEASE HELP How have phones made us spoiled? How have phones made us unhappy?
    10·1 answer
  • Explain why a holiday on a cruise liner will be an ideal holiday​
    12·1 answer
  • Please help……Your friend is taking images from all over the internet without giving credit to the sources. He tells you that it’
    6·1 answer
  • What does it mean when someone says your voice doesn’t match how u look
    7·1 answer
  • How desktop case or chassis designed?, material and steps?​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!