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
Why is my computer fans making weird noises?
sattari [20]

Answer:

The biggest culprit for excess noise in computers Computer internal devices all generate "heat."  Most computers manufacturer add temperature controller fans on important internal devise or locations.  These will spin faster when "hot" temperatures are detected.  With the fans, there are usually "ventilation holes" needed to push this hot "air" out.  Unfortunately, these holes let in dust and "other debris' into the fans, thus making them "spin" harder and faster. This is normal. You might want to take your computer to your school's office and ask them about your. computer. I think I have a solution below but I am not sure it will work.

Check to make sure that your computer is set to use all of your speakers. Navigate to the Control Panel, and double-click Sounds And Audio Devices. If you change this setting, click Apply, OK, and then OK again to exit the Sounds And Audio Devices Properties dialog box.

Hope this answer helped you have a good day.  :)

3 0
2 years ago
Read 2 more answers
Instructions:Select the correct answer.
Dafna1 [17]
It would be a audio file -B.
8 0
3 years ago
which of the following is an educated or informed guess that is proposed and supported with verifiable evidence
beks73 [17]

The answer is Hypothesis.  It is something more than just a wild guess but less than a well-established theory, a theory which can be tested through study and experimentation..  They are assumptions generally believed to be true. They are provisionally accepted in order to interpret certain events or phenomena, and to provide guides for further study.

6 0
3 years ago
What is output? c = 1 sum = 0 while (c &lt; 10): c = c + 3 sum = sum + c print (sum)
Valentin [98]

Answer:

21

Explanation:

The values of c that make it into the loop are 1, 4, 7.

The values that are added to sum are 3 higher, i.e., 4,7 and 10.

The sum of those is 21.

p.s. why did you not run the program yourself?

3 0
3 years ago
How can touch typing increase productivity of a business?
Sladkaya [172]

Answer:

Increasing your typing speed will improve your productivity and save you time. Having a good typing speed will improve your job satisfaction.

Explanation:

hope his helps

3 0
2 years ago
Read 2 more answers
Other questions:
  • Why is self-esteem important in self-representation
    7·1 answer
  • What is the purpose for adding images and graphics to a web page?
    5·1 answer
  • :If a process terminates, will its threads also terminate or will they continue to run? Explain your answer.
    14·1 answer
  • You are developing a system to process lists of days of the week, represented as strings. Create a function is_weekend that cons
    12·1 answer
  • Write a C# program named DoubleDecimalTest thatdeclares and displays two variables - a double and a decimal.Experiment by assign
    9·1 answer
  • If you can name this you get 15 points: ↑↑↓↓←→←→βα
    10·1 answer
  • True or False? Using your traffic analytics report, you can see the source of traffic to your website
    13·1 answer
  • Buying the newest phone as soon as it is released when your current phone works perfectly is not a good idea for all but which o
    10·2 answers
  • The purpose of Appetizers on the menu​
    6·2 answers
  • Draw
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!