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
What is the different sheets in excel
enyata [817]

Answer:

By clicking the sheet tabs at the bottom of the Excel window, you can quickly select one or more sheets. To enter or edit data on several worksheets at the same time, you can group worksheets by selecting multiple sheets. You can also format or print a selection of sheets at the same time.

Explanation:

hope this helps

5 0
3 years ago
Computer is a major source of informarion why​
eimsori [14]

Answer:

The answer to this question is given below is the explanation section.

Explanation:

Computer can  process and store data.It can easily store large amount of data and process the data very fast but it is not the source of information it serve as a store of information because it store information and whenever we need any information we can retrieve that information from computer memory.in this way computer is s source of information.

8 0
3 years ago
If 209g of ethanol are used up in a combustion process, calculator the volume of oxygen used for the combustion at stp​
SOVA2 [1]

Answer:

a) The volume of oxygen used for combustion at STP is approximately 305 dm³

b) The volume of gas released during combustion at STP is approximately 508 dm³

Explanation:

The given chemical reaction equation for the burning of ethanol in air, is presented as follows;

2CH₃CH₂OH (l) + 6O₂ (g) → 4CO₂ (g) + 6H₂O

The mass of ethanol used up in the combustion process, m = 209 g

The molar mass of ethanol, MM = 46.06844 g/mol∴

The number of moles of ethanol in the reaction, n = m/MM

∴ n = 209 g/(46.06844 g/mol) ≈ 4.537 moles

a) Given that 2 moles of ethanol, CH₃CH₂OH reacts with 6 moles of oxygen gas molecules, O₂, 4.54 moles of ethanol will react with (6/2) × 4.537 = 13.611  moles of oxygen

The volume occupied by one mole os gas at STP = 22.4 dm³

The volume occupied by the 13.611 moles of oxygen gas at STP, 'V', is given as follows;

V = 13.611 mol × 22.4 dm³/mole = 304.8864 dm³ ≈ 305 dm³

The volume occupied by the 13.611 moles of oxygen gas at STP, V = The volume of oxygen used for the combustion ≈ 305 dm³

b) The total number of moles of gases released in the reaction, is given as follows;

The total number of moles = (4.537/2) × (4 + 6) = 22.685 moles of gas

The total volume of gas released, V_T = The volume of gas released during the combustion at STP = 22.685 moles × 22.4 dm³/mole = 508.144 dm³ ≈ 508 dm³

7 0
3 years ago
Write a statement that declares a prototype for a function powerTo, which has two parameters. The first is a double and the seco
Dimas [21]

Answer:

Following are the statement of the program in the C++ Programming Language.

//prototype of the function

double powerTo (double, int);

Explanation:

In the following statement which is written in the C++ Programming Language.

  • The function prototype tells us what type of data type return by that function.
  • We declare the prototype of the function "powerTo()" which returns the double and pass two arguments first one is double data type and the second one is integer data type.
7 0
4 years ago
How to determine the critical crack size for a<br> plate
Blababa [14]
Wait what? is that really a question orr
7 0
3 years ago
Other questions:
  • What is ment by creative middle way solution
    6·1 answer
  • on average, someone with a bachelor’s degree is estimated to earn _______ times more than someone with a high school diploma
    13·1 answer
  • George and Miguel want to know more about their local and online competitors and about the retail industry. What is the best way
    9·1 answer
  • Describe any four rights of users of information systems.
    8·1 answer
  • Show the stack with all activation record instances, including static and dynamic chains, when execution reaches position 1 in t
    6·1 answer
  • Can you combine a wireless and wired lan in the same home
    14·1 answer
  • PMI is a: computer program used to help managers write mission statements. rule of thumb used to determine how many employees sh
    15·1 answer
  • 2. Which of the following is a shortcut key to Exit from any operation?
    10·2 answers
  • Today's manufacturing workplace is most likely to include
    8·1 answer
  • nts/viewer/classes/289ef1a5d7c341c284010 Select the compound inequality shown on the graph. 5 4 3 2 1 0 1 2 를 4​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!