Reset author name to chosen name ✨
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package lab12_chloefontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author chloe
|
||||
*/
|
||||
public class NestedWhilePatternD {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// Define variables
|
||||
int numberOfLines = 6;
|
||||
int rows = 1;
|
||||
int spacing;
|
||||
int collums;
|
||||
|
||||
//Main while looping
|
||||
while (rows <= numberOfLines) {
|
||||
spacing = numberOfLines - rows;
|
||||
while (spacing < 6) { //Spacing
|
||||
System.out.print(" ");
|
||||
spacing++;
|
||||
}
|
||||
collums = rows;
|
||||
while (collums <= 6) { // Number printing
|
||||
System.out.print((collums - rows + 1) + " ");
|
||||
collums++;
|
||||
}
|
||||
System.out.println();
|
||||
rows++;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user