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
Forms open in _______, which provides a user-friendly interface for entering data.
sergey [27]
They open in pdf format

5 0
3 years ago
What is the iterative procedure of recursive and nonrecursive?
DanielleElmas [232]

Answer:

nonrecursive

Explanation:

3 0
3 years ago
Robert's got a quick hand
Alina [70]
verry
good
song
love
it
6 0
2 years ago
Read 2 more answers
In a "block" containment strategy, in which the attacker's path into the environment is disrupted, you should use the most preci
Slav-nsk [51]
The containment strategy prevents intruders from removing information assets from the network, and prevents attackers from using the organization's network as a launch point for subsequent attacks.
In a "block" containment strategy, in which the attacker's path into the environment is disrupted, you should use the most precise strategy possible, starting with <span>blocking a specific IP address. Correct answer: C

</span>

8 0
3 years ago
List two ways that search engines and electronic databases are similar and three ways that search engines and electronic databas
antoniya [11.8K]

Answer:

Explanation: search engine uses system algorithm to search out items or information as required by the user. Example is google, chrome.

Data base are archives where information could be retrieve. Its contain information such as publications, abstract,journals.

Search engine provides wide range of information depending on you request while database are mostly for academics related materials.

Data base- A good place to generate this information is library, archivals while journal, publiications are kept while search engine can be used anywhere you have an internet facilities.

In a data base, information is searched in an organized way. The collections are already well arranged in different cubicle search engine provides wide range of information not organized.

Data base may contain more complex information not easily understood, search engine provides more elaborate answers.

Similarity of the two is that they both provide information.

They are both reliable.

School library is an example of where journals and publication are kept and can be retrived.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following represent typical account fees?
    7·1 answer
  • If a hypothesis is strongly supported by the scientific community based on compelling experiment results, it becomes a————
    10·2 answers
  • The icons to insert footnotes and endnotes in a document are located in the _____ tab.
    8·1 answer
  • Explain the saying "Dress for the position you want, not the position you have."
    6·2 answers
  • Consider the following program where the zu format specifier is used to display as an integer the result of sizeof. #include #in
    11·1 answer
  • I can't solve this <br> Python loop with while statement
    15·2 answers
  • In what ways is the human brain like a computer? In what ways is it different?
    14·2 answers
  • True or false scientists investigate and seek to explain the natural world
    14·1 answer
  • When did time begin?
    11·1 answer
  • consider a pipelined risc cpu with 14 stages. what is maximum speedup of this cpu over a non-pipelined implementation?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!