'F' → Fullscreen
Everything today goes in a new program named 1-21-nested-loops.
How to read the code blocks. Each task's code block shows your whole program, from line 1, as it should look when that task is finished.
The green lines marked with a + are the ones you add or change for that task — everything else is already in your file. Do not type the + sign.
Where a block shows only comments, you write that code yourself. The comments stay in your file.
for (int row = 1; row <= 3; row++){ for (int seat = 1; seat <= 4; seat++) { Console.WriteLine($"Row {row} Seat {seat}"); }}Console.WriteLine(). It is inside the outer loop and below the inner loop, and it is the only thing that ends a row.Console.Write, which does not move to a new line. Six of those in a row put six stars on one line.for (int row = 1; row <= 3; row++){ for (int seat = 1; seat <= 4; seat++) { Console.WriteLine($"Row {row} Seat {seat}"); }}
Console.WriteLine();
for (int row = 1; row <= 4; row++){ for (int col = 1; col <= 6; col++) { Console.Write("* "); }
Console.WriteLine();}for (int row = 1; row <= 3; row++){ for (int seat = 1; seat <= 4; seat++) { Console.WriteLine($"Row {row} Seat {seat}"); }}
Console.WriteLine();
for (int row = 1; row <= 4; row++){ for (int col = 1; col <= 6; col++) { Console.Write("* "); }
Console.WriteLine();}
Console.WriteLine();
// Ask the user for a size and convert it// Print a triangle that many rows tall:// row 1 has one star, row 2 has two, and so on// the inner loop's limit is the outer loop's variableBoth changes are to the same line — the empty Console.WriteLine() in your grid. Write down exactly what happens, and put it back before the next one.
Console.Write. Run it and count the lines.For each one, record how many lines the grid section printed and how many stars were on each. The star total does not change; only its shape does.
Neither version is an error. Both compile, both run, and neither warns you about anything. Say what that one line actually does, now that you have seen the grid, the column, and the single line it sits between.
Your finished program, with 4 as the triangle size.
Row 1 Seat 1Row 1 Seat 2Row 1 Seat 3Row 1 Seat 4Row 2 Seat 1Row 2 Seat 2Row 2 Seat 3Row 2 Seat 4Row 3 Seat 1Row 3 Seat 2Row 3 Seat 3Row 3 Seat 4
* * * * * ** * * * * ** * * * * ** * * * * *
Size? 4 [Enter]** ** * ** * * *Answer the following questions before submitting your work.
Console.WriteLine() changed your grid into a column, and deleting it made a single long line. Describe what that line does and why its position matters so much.Submit four things to the dropbox: