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
scoundrel [369]
3 years ago
15

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 = currentColumnLetter
for(currentRow = 0; currentRow < numRows;currentRow++){
for(currentColumn = =

System.out.println("");
}
}
Computers and Technology
1 answer:
Free_Kalibri [48]3 years ago
4 0

Answer:

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;

       

       System.out.print("Enter number of rows: ");

       numRows = scnr.nextInt();

       System.out.print("Enter number of columns: ");

       numColumns = scnr.nextInt();

       

       for(int i = 1; i <= numRows; i++){

           currentColumn = 1;

           currentColumnLetter = 'A';

           for(int j = 1; j <= numColumns; j++){

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

               currentColumn++;

               currentColumnLetter++;

           }

       }

}

}

Explanation:

Ask user to enter the number of <em>rows</em> and <em>columns</em>.

Create a nested for loop, outer loop goes until <em>numRows</em> and inner loop goes until <em>numRows</em>.

Inside the first loop, set <em>currentColumn</em> to 1 and <em>currentColumnLetter</em> to 'A'. This way for after each row column value starts from 1 and letter value starts from A.

Insite the second loop, print the row value - <em>i</em>, and <em>currentColumnLetter</em>. Also,increment <em>currentColumn</em> and <em>currentColumnLetter</em> values by 1.

You might be interested in
After running a Google Search Ads campaign for several months, Meredith notices sales of her advertised products are starting to
lesya692 [45]

Answer:

The campaign could be improved by 78% if the listed recommendations are followed.

Explanation:

While conducting the following Search advertising program for a few months, Meredith has announced that revenues of its branded goods are beginning to slow. She reviews her Google Advertising Suggestions webpage which states that her campaign's performance ranking is 22 points.

Thus, the campaign will be increased by 78% if the above recommendations are implemented to inform Meredith regarding its Google Search Advertising plan.

5 0
3 years ago
In ANSI standard C(1989) code - this is what we are teaching- declarations can occur in a for statementas in
tatiyna

Answer:

true is the answer to this

8 0
3 years ago
_______ are fasteners that connect parts and are intended to resist pulling forces. A. Extension springs B. Compression springs
madam [21]
The answer is Lock washers
6 0
4 years ago
When you call a ____________ method, it executes statements it contains and then returns a value back to the program statement t
Maksim231197 [3]

Answer:

The answer is a VOID method.

Explanation:

A void method is one that simply performs a task and then terminates.

4 0
4 years ago
Read 2 more answers
Which of these are variables in an organization? Choose three.
Rzqust [24]

Answer:

Example of organizational variables are codes of ethics, ethical climate, organizational size, top management, organizational structure and organization culture.

Explanation:

Organizational variables can be defined as characteristics of a decision that influences the decision-making process and its outcome. This organizational variables also influence how an individual makes decisions.

Example of organizational variables are codes of ethics, ethical climate, organizational size, top management, organizational structure and organization culture.

6 0
3 years ago
Other questions:
  • A DSLR camera is made up of two parts. They are
    13·2 answers
  • Carmen wanted to clear up space on her computer and remove unwanted files. What would be the best for her to delete?
    6·2 answers
  • A​ __________ is a commonly used tool for showing how the parts of a whole are distributed.
    11·1 answer
  • Which internet site end in .com​
    10·2 answers
  • What width would you choose for the pdf?
    12·1 answer
  • While saving her word-processed academic documents, Ashley includes the subject, title, and the author's name in the properties.
    7·1 answer
  • PLEASE HURRY PLEASE HELP THIS CLASS ENDS TODAY AND I NEED HELP
    7·1 answer
  • The following method is intended to remove all values from the ArrayList a that have the same value as val; however, this method
    8·1 answer
  • Given the following class: Create a class MyGenerator that can be used in the below main method.
    8·1 answer
  • I need this answered
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!