Closed zafienas closed 3 years ago
//Developer: Nadiah Ismail
//Task: Display Pattern A
public class PatternA {
public static void main (String [] args){
final int ROW = 6;
for (int i = 1; i <= ROW; i++) {
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
//Developer: Nadiah Ismail
//Task: Display Pattern B
public class PatternB {
public static void main(String[] args) {
final int ROW = 1;
for (int i = 6; i >= ROW; i--) {
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
//Developer: Nadiah Ismail
//Task: Display Pattern C
public class PatternC {
public static void main(String[] args) {
final int ROW = 6;
for (int i = 1; i <= ROW; i++) {
for (int j = 1; j <= ROW - i; j++) {
System.out.print(" ");
}
for (int j = 1; j <= i; j++) {
System.out.print(" *");
}
System.out.println("");
}
}
}
//Developer: Nadiah Ismail
//Task: Display Pattern D
public class PatternD {
public static void main(String[] args) {
final int ROW = 6;
for (int i = ROW; i >= 1; i--) {
for (int j = ROW; j > i; j--) {
System.out.print(" ");
}
for (int k = 1; k <= i; k++) {
System.out.print(" *");
}
System.out.println();
}
}
}
JAVA SOURCE CODE
//Developer: Wan Nurfarah Binti Wan Zulkifli
//Task: Display Pattern A
public class PatternA {
public static void main(String[] args) {
for(int i = 1; i <= 6; i++) {
for(int j = 1; j <= i; j++) {
System.out.print(" * ");
}
System.out.println();
}
}
}
OUTPUT PATTERN A
JAVA SOURCE CODE
//Developer: Wan Nurfarah Binti Wan Zulkifli
//Task: Display Pattern B
public class PatternB {
public static void main(String[] args) {
for(int i = 1; i <= 6; i++) {
for(int j = 1; j <= 7 - i; j++) {
System.out.print(" * ");
}
System.out.println();
}
}
}
OUTPUT PATTERN B
JAVA SOURCE CODE
//Developer: Wan Nurfarah Binti Wan Zulkifli
//Task: Display Pattern C
public class PatternC {
public static void main(String[] args) {
for(int i = 1; i <= 6; i++) {
for(int k = 1; k <= 6 - i; k++) {
System.out.print(" ");
}
for(int j = 1; j <= i; j++) {
System.out.print(" *");
}
System.out.println();
}
}
}
OUTPUT PATTERN C
JAVA SOURCE CODE
//Developer: Wan Nurfarah Binti Wan Zulkifli
//Task: Display Pattern D
public class PatternD {
public static void main(String[] args) {
for(int i = 1; i <= 6; i++) {
for(int k = i; k > 1; k--) {
System.out.print(" ");
}
for(int j = 1; j <= 7 - i; j++) {
System.out.print(" *");
}
System.out.println();
}
}
}
OUTPUT PATTERN D
//Developer: SITI NUR SYAZIMAH BINTI ABU (203023)
//Task: Pattern A
public class PatternA {
public static void main(String[] args) {
int counter = 6;
for(int i = 1; i <= counter; ++i){
for(int j = 1; j <= i; ++j){
System.out.print("* ");
}
System.out.print("\n");
}
}
}
//Developer: SITI NUR SYAZIMAH BINTI ABU (203023)
//Task: Pattern B
public class PatternB {
public static void main(String[] args) {
int counter = 6;
for (int i = counter; i >= 1; --i) {
for (int j = 1; j <= i; ++j) {
System.out.print("* ");
}
System.out.println();
}
}
}
//Developer: SITI NUR SYAZIMAH BINTI ABU (203023)
//Task: Pattern C
public class PatternC {
public static void main(String[] args) {
int counter = 6, j;
for(int i = 0; i < counter; i++)
{
for(j = 2*(counter - i); j >= 0; j--)
{
System.out.print(" ");
}
for(j = 0; j<=i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
//Developer: SITI NUR SYAZIMAH BINTI ABU (203023)
//Task: Pattern D
public class PatternD {
public static void main(String[] args) {
int counter = 1;
for(int i = 6; i >= counter; i--)
{
for(int j = 6; j >= i; j--)
{
System.out.print(" ");
}
for(int k = 1; k <= i; k++) {
System.out.print("*");
}
System.out.println();
}
}
}
//Developer : Farhana Yusri
//Task : Pattern A
public class PatternLoop {
public static void main (String [] args) {
for (int r= 0; r<=6; r++) {
for(int c= 0; c<r; c++ ){
System.out.print("* ");
}
System.out.println();
}
}
}
//Developer : Farhana Yusri
//Task : Pattern B
public class PatternLoop {
public static void main (String [] args) {
for (int r= 6; r>=1; r--) {
for(int c= 1; c<=r; c++ ){
System.out.print("* ");
}
System.out.println();
}
}
}
//Developer : Farhana Yusri
//Task : Pattern C
public class PatternLoop {
public static void main(String[] args) {
int r,n=6,c;
for( r=0; r<n; r++)
{
for( c=2*(n-r); c>=0; c--)
{
System.out.print(" ");
}
for(c=0; c<=r; c++)
{
System.out.print("* ");
}
System.out.println();
}
}
}
//Developer: Farhana Yusri
//Task: Pattern D
public class Loop {
public static void main(String[] args) {
final int r = 6;
for (int i = r; i >= 1; i--) {
for (int c = r ; c > i; c--) {
System.out.print(" ");
}
for (int k = 1; k <= i; k++) {
System.out.print(" *");
}
System.out.println();
}
}
}
Pattern A
//Developer: me98
public class PatternA {
public static void main (String [] args ) {
int rows = 6;
System.out.println("Pattern A" );
for (int i = 1; i <= rows; ++i) {
for (int j = 1; j <= i; ++j) {
System.out.print("* ");
}
System.out.println();
}
}
}
Pattern B
//developer:me
public class PatternB {
public static void main (String [] args) {
//enter how many rows wanted as output
int rows = 6;
System.out.println("Pattern B" );
for (int i = rows; i >= 1; --i) {
for (int j = 1; j <= i; ++j) {
System.out.print("* ");
}
System.out.println();
}
}
}
Pattern C
//Developer Farhanazul
public class TryPatternC {
public static void main (String [] args ) {
int rows = 6;
System.out.println("Pattern C");
for (int i = 1; i <= rows; ++i) {
for (int space = 1; space <= rows - i; ++space) {
System.out.print(" ");
}
for(int j = 2 * i - 1; j >= i; --j) {
System.out.print("* ");
}
System.out.println();
}
}
}
Pattern D
//Developer: me fzul
public class TryPatternD {
public static void main (String [] args) {
int rows = 6;
System.out.println("Pattern D");
for(int i = rows; i >= 1; --i) {
for(int space = 1; space <= rows - i; ++space) {
System.out.print(" ");
}
for(int j = i; j <= 2 * i - 1; ++j) {
System.out.print("* ");
}
System.out.println();
}
}
}
Pattern A
//Developer : Siti Nurfatihah bt Rozaidi (202934)
//Task : Lab4PatternA
public class PatternA {
public static void main(String[] args) {
for (int i = 0; i <= 6; i++) {
for (int j = 0; j < i; j++) {
System.out.print(" * ");
}
System.out.println();
}
}
}
Pattern B
//Developer : Siti Nurfatihah bt Rozaidi (202934)
//Task : Lab4PatternB
public class PatternB {
public static void main(String[] args) {
for (int i = 6; i >= 1; i--) {
for (int j = 1; j <= i; j++) {
System.out.print(" * ");
}
System.out.println();
}
}
}
Pattern C
//Developer : Siti Nurfatihah bt Rozaidi (202934)
//Task : Lab4PatternC
public class PatternC {
public static void main(String[] args) {
int i , j ;
int n=6;
for( i=0; i<n; i++)
{
for( j=2*(n-i); j>=0; j--)
{
System.out.print(" ");
}
for(j=0; j<=i; j++)
{
System.out.print("* ");
}
System.out.println();
}
}
}
Pattern D
//Developer : Siti Nurfatihah bt Rozaidi (202934)
//Task : Lab4PatternD
public class PatternD {
public static void main(String[] args) {
int i,j,k;
for( i = 1; i <= 6; i++) {
for( k = i; k > 1; k--) {
System.out.print(" ");
}
for(j = 1; j <= 7 - i; j++) {
System.out.print(" *");
}
System.out.println();
}
}
}
// Developer : Masturah Binti Mokhtar
// Task : Pattern
public class pattern {
public static void main(String[] args) {
System.out.println("\n\nPattern A");
for (int i = 1; i <= 6; i++) {
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
System.out.println("\n\nPattern B");
for (int i = 1; i <= 6; i++) {
for (int j = 1; j <= 7 - i; j++) {
System.out.print("* ");
}
System.out.println();
}
System.out.println("\n\nPattern C");
for (int i = 1; i <= 6; i++) {
for (int k = 1; k <= 6 - i; k++) {
System.out.print(" ");
}
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println(); }
System.out.println("\n\nPattern D");
for (int i = 1; i <= 6; i++) {
for (int k = i; k > 1; k--)
{
System.out.print(" ");
}
for (int j = 1; j <= 7 - i; j++) {
System.out.print("* ");}
System.out.println(); }
}
}
//Display: Hazirah Rosli
//Task: Display Pattern A
public class PatternA {
public static void main(String[] args){
for (int i = 1; i <= 6; i++){
for (int j = 1; j <= i; j ++){
System.out.print(" * ");
}
System.out.println();
}
}
}
//Developer: Hazirah Rosli
//Task: Dislpay Pattern B
public class PatternB {
public static void main(String[] args){
for(int i = 1; i <= 6; i++) {
for(int j = 1; j <= 7 - i; j++) {
System.out.print(" * ");
}
System.out.println();
}
}
}
//Developer: Hazirah Rosli
//Task: Display Pattern C
public class PatternC {
public static void main(String[] args) {
for(int i = 1; i <= 6; i++) {
for(int k = 1; k <= 6 - i; k++) {
System.out.print(" ");
}
for(int j = 1; j <= i; j++) {
System.out.print(" *");
}
System.out.println();
}
}
}
//Developer : Hazirah Rosli
//Task: Dislpay Pattern D
public class PatternD {
public static void main(String[] args){
for(int i = 1; i <= 6; i++){
for(int k = i; k > 1; k--){
System.out.print(" "); // guna print kalau nak buat pyramid
}
for(int j = 1; j <= 7-i; j++){
System.out.print(" *");
}
System.out.println(); // luar guna println
}
}
}
//Danish 204596
//Pattern A
public class Pattern_A {
public static void main (String [] args){
final int ROW = 6;
for (int i = 1; i <= ROW; i++) {
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
//Danish 204596
//Pattern B
public class Pattern_B {
public static void main(String[] args) {
final int ROW = 1;
for (int i = 6; i >= ROW; i--) {
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
//Danish 204596
//Pattern C
public class Pattern_C {
public static void main(String[] args) {
final int ROW = 6;
for (int i = 1; i <= ROW; i++) {
for (int j = 1; j <= ROW - i; j++) {
System.out.print(" ");
}
for (int j = 1; j <= i; j++) {
System.out.print(" *");
}
System.out.println("");
}
}
}
//Danish 204596
//Pattern D
public class Pattern_D {
public static void main(String[] args) {
final int ROW = 6;
for (int i = ROW; i >= 1; i--) {
for (int j = ROW; j > i; j--) {
System.out.print(" ");
}
for (int k = 1; k <= i; k++) {
System.out.print(" *");
}
System.out.println();
}
}
}
//Developer: NUR HANIS HAZIQAH BINTI HISHAM HAIZAD(202936)
//TASK : PATTERN A
package com.company;
public class PatternA {
public static void main(String[] args) {
for(int i = 1; i <= 6; ++i){
for(int j = 1; j <= i; j++) {
System.out.print( " * ");
}
System.out.print("\n");
}
}
}
//Developer: NUR HANIS HAZIQAH BINTI HISHAM HAIZAD(202936)
//TASK : PATTERN B
package com.company;
public class PatternB {
public static void main(String[] args) {
for(int i = 6; i >= 1;--i){
for (int j = 1; j <= i;j++ ) {
System.out.print( " * ");
}
System.out.print("\n");
}
}
}
//Developer: NUR HANIS HAZIQAH BINTI HISHAM HAIZAD(202936)
//TASK : PATTERN C
package com.company;
public class PatternC {
public static void main(String[] args) {
for(int i=6; i >= 1 ;i--) {
for (int j = 1; j < i; j++)
{
System.out.print(" ");
}
for (int k = 6; k >= i; k--)
{
System.out.print(" * ");
}
System.out.println();
}
}
}
//Developer: NUR HANIS HAZIQAH BINTI HISHAM HAIZAD(202936)
//TASK : PATTERN D
package com.company;
public class PatternD {
public static void main(String[] args) {
for(int i = 6; i >=1; i-- ){
for(int k = 6; k >= i; k--)
{
System.out.print( " ");
}
for(int j = 1 ; j<=i;j++)
{
System.out.print( " * ");
}
System.out.println();
}
}
}
//Developer: Noor Husna
//Task: Display Pattern A
public class PatternA {
public static void main (String [] args){
final int ROW = 6;
for (int i = 1; i <= ROW; i++) {
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
//Developer: Noor Husna
//Task: Display Pattern B
public class PatternB {
public static void main(String[] args) {
final int ROW = 1;
for (int i = 6; i >= ROW; i--) {
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
//Developer: Noor Husna
//Task: Display Pattern C
public class PatternC {
public static void main(String[] args) {
final int ROW = 6;
for (int i = 1; i <= ROW; i++) {
for (int j = 1; j <= ROW - i; j++) {
System.out.print(" ");
}
for (int j = 1; j <= i; j++) {
System.out.print(" *");
}
System.out.println("");
}
}
}
//Developer: Noor Husna
//Task: Display Pattern D
public class PatternD {
public static void main(String[] args) {
final int ROW = 6;
for (int i = ROW; i >= 1; i--) {
for (int j = ROW; j > i; j--) {
System.out.print(" ");
}
for (int k = 1; k <= i; k++) {
System.out.print(" *");
}
System.out.println();
}
}
}
// Developer : Nurul Izzati Syahzanani Binti Farooq Azam
// Task : Nested Loops (Lab 4)
public class NestedLoops {
public static void main(String[] args) {
patternA();
patternB();
patternC();
patternD();
}
public static void patternA() {
System.out.println("Pattern A");
int counter = 6;
for (int i = 1; i <= counter; ++i) {
for (int j = 1; j <= i; ++j) {
System.out.print("* ");
}
System.out.println();
}
System.out.println("--------------------------------------");
}
public static void patternB() {
System.out.println("Pattern B");
int counter = 6;
for (int i = counter; i >= 1; --i) {
for (int j = 1; j <= i; ++j) {
System.out.print("* ");
}
System.out.println();
}
System.out.println("--------------------------------------");
}
public static void patternC() {
System.out.println("Pattern C");
int counter = 6;
for (int i = 1; i <= counter; i++) {
for (int j = 1; j <= counter - i; j++) {
System.out.print(" ");
}
for (int j = 1; j <= i; j++) {
System.out.print(" *");
}
System.out.println();
}
System.out.println("--------------------------------------");
}
public static void patternD() {
System.out.println("Pattern D");
int counter = 6;
for (int i = counter; i >= 1; i--) {
for (int j = counter; j > i; j--) {
System.out.print(" ");
}
for (int k = 1; k <= i; k++) {
System.out.print(" *");
}
System.out.println();
}
System.out.println("--------------------------------------");
}
}
//Developer: Azim
//Task: Star Pyramid 1
public class NumberPractice2 {
public static void main(String[] args) {
int lines= 6;
for (int i = 1; i <= lines; i++) {
for (int j = 1; j <= i; j++) {
System.out.print(" * ");
}
System.out.println();
}
}
}
//Developer: Azim
// Task: Number pyramid 2
public class NumberPractice3 {
public static void main(String[] args) {
int lines = 6;
for (int i = lines; i >= 1; --i) {
for (int j = 1; j <= i; ++j) {
System.out.print("* ");
}
System.out.println();
}
}
}
// Developer: Azim
// Task: Pyramid number 3
public class NumberPractice4 {
public static void main(String[] args) {
final int lines = 6;
for (int i = 1; i <= lines; i++) {
for (int j = 1; j <= lines - i; j++) {
System.out.print(" ");
}
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println("");
}
}
}
// Developer: Azim
// Task: Number pyramid 4
public class NumberPractice5 {
public static void main(String[] args) {
int line =6;
for
(int i = 1; i <= 6; i++) {
for(int k = i; k > 1; k--) {
System.out.print(" ");
}
for(int h = 1; h <= 7 - i; h++) {
System.out.print(" *");
}
System.out.println();
}
}
}
//developer: Elya Maisarah (202487)
//Task: Pattern A
public class Question1 {
public static void main(String[] args) {
int rows = 6;
for (int i = 1; i <= rows; i++) {
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
//developer: Elya Maisarah (202487)
//Task: Pattern B
public class patternB {
public static void main(String[] args) {
int rows = 6;
for (int i = rows; i >= 1; i--) {
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
//developer:Elya Maisarah (202487)
//Task: Pattern C
public class patternC {
public static void main(String[] args) {
int rows = 6;
for (int i = 1; i <= rows; i++) {
for( int j=2*(rows-i); j>=0; j--) {
System.out.print(" ");
}
for(int j=1; j<=i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
//developer:Elya Maisarah (202487)
//Task: Pattern D
public class patternD {
public static void main(String[] args) {
int rows = 6;
for (int i = rows; i >= 1; i--) {
for (int j=2*(rows-i); j>=0; j--) {
System.out.print(" ");
}
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
Pattern A
// Developer : Azeelah Yasmin Bt Azlee
// Task : Pattern A
public class q1patternA {
public static void main(String[] args) {
for(int i=1; i <=6; i++){
for(int j =1;j<=i; j++){
System.out.print(" * ");
}
System.out.println("\n");
}
}
}
//Developer : Azeelah Yasmin Bt Azlee
// Task : Pattern B
public class q1patternB {
public static void main (String [] Args){
for(int i=6; i >=1; i--){
for(int j =1;j<=i; j++){
System.out.print(" * ");
}
System.out.println("\n");
}
}
}
//Developer : Azeelah Yasmin Bt Azlee
//Task : Task C
public class q1patternC {
public static void main(String[] args) {
final int row = 6;
for( int i = 1; i <= row; i++){
for(int j = 1; j <= row - i; j++){
System.out.print(" ");
}
for(int j = 1; j <= i; j++){
System.out.print(" *");
}
System.out.println();
}
}
}
//Developer : Azeelah Yasmin Bt Azlee
//Task : Task D
public class q1patternD {
public static void main(String[] args) {
final int row = 6;
for( int i = row; i >= 1; i--){
for(int j = row; j > i; j--){
System.out.print(" ");
}
for(int j = 1; j <= i; j++){
System.out.print(" *");
}
System.out.println();
}
}
}
//Developer name=Nur Fakhira Adriana
public class soalan1 {
public static void main(String[] strings) {
System.out.println("\n\nPattern A");
for (int i = 1; i <= 6; i++) {
for (int j = 1; j <= i; j++) {
System.out.print(" * ");
}
System.out.println();
}
System.out.println("\n\nPattern B");
for (int i = 1; i <= 6; i++) {
for (int j = 1; j <= 7 - i; j++) {
System.out.print(" * ");
}
System.out.println();
}
System.out.println("\n\nPattern C");
for (int i = 1; i <= 6; i++) {
for (int k = 1; k <= 6 - i; k++) {
System.out.print(" ");
}
for (int j = 1; j <= i; j++) {
System.out.print(" * ");
}
System.out.println();
}
System.out.println("\n\nPattern D");
for (int i = 1; i <= 6; i++) {
for (int k = i; k > 1; k--) {
System.out.print(" ");
}
for (int j = 1; j <= 7 - i; j++) {
System.out.print(" * ");
}
System.out.println();
}
}
}
//Developer: Abdul Azim (203198)
//Task: Display Pattern A,B,C,D
public class PatternABCD {
public static void main (String [] args) {
// Pattern A
System.out.println("'Pattern A'");
for (int x = 0; x <= 6; x++) {
for(int y = 0; y < x; y++ ){
System.out.print(" * ");
}
System.out.println();
}
// Pattern B
System.out.println("\n 'Pattern B' ");
for(int x = 1; x <= 6; x++) {
for(int y = 1; y <= 7 - x; y++) {
System.out.print(" * ");
}
System.out.println();
}
// Pattern C
System.out.println("\n 'Pattern C' ");
for(int x = 1; x <= 6; x++) {
for(int y = 1; y <= 6 - x; y++) {
System.out.print(" ");
}
for(int y = 1; y <= x; y++) {
System.out.print(" *");
}
System.out.println();
}
// Pattern D
System.out.println("\n 'Pattern D' ");
for(int x = 1; x <= 6; x++) {
for(int y = 1; y > x - x; y--) {
System.out.print(" ");
}
for(int z = 1; z <= 7 - x; z++) {
System.out.print(" *");
}
System.out.println();
}
}
}
![Pattern ABCD](https://user-images.githubusercontent.com/25761177/102567687-034a7380-411d-11eb-8937-1102c4341727.JPG)
//Developer: Nurul Haswani Bt Ariffin
//Matric: 203024
public class patternA {
public static void main (String [] args){
final int ROW = 6;
for (int i = 1; i <= ROW; i++) {
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
//Developer: Nurul Haswani Bt Ariffin
//Matric: 203024
public class patternB {
public static void main(String[] args) {
final int ROW = 1;
for (int i = 6; i >= ROW; i--) {
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
//Developer: Nurul Haswani Bt Ariffin
//Matric: 203024
public class patternC {
public static void main(String[] args) {
final int ROW = 6;
for (int i = 1; i <= ROW; i++) {
for (int j = 1; j <= ROW - i; j++) {
System.out.print(" ");
}
for (int j = 1; j <= i; j++) {
System.out.print(" *");
}
System.out.println("");
}
}
}
//Developer: Nurul Haswani Bt Ariffin
//Matric: 203024
public class patternD {
public static void main(String[] args) {
final int ROW = 6;
for (int i = ROW; i >= 1; i--) {
for (int j = ROW; j > i; j--) {
System.out.print(" ");
}
for (int k = 1; k <= i; k++) {
System.out.print(" *");
}
System.out.println();
}
}
}
//Developer: Norshasha Sorfina
//Task : Pattern A
public class Q1PatternA {
public static void main(String[] args) {
for (int i = 0; i <= 5; i++)
{
for (int j = 0; j <= i; j++)
{
System.out.print("*" + " ");
}
System.out.println();
}
}
}
//Developer: Norshasha Sorfina
//Task : Pattern B
public class Q1PatternB {
public static void main(String[] args) {
for (int i = 0; i <= 5; i++)
{
for (int j = i; j <= 5; j++)
{
System.out.print("*" + " ");
}
System.out.println();
}
}
}
//Developer: Norshasha Sorfina
//Task : Pattern C
public class Q1PatternC {
public static void main(String[] args) {
for (int i = 1; i <= 6; i++)
{
for (int k = 5; k >= i; k--)
{
System.out.print(" ");
}
for (int j = 1; j <= i; j++)
{
System.out.print("*" + " ");
}
System.out.println();
}
}
}
//Developer: Norshasha Sorfina
//Task : Pattern D
public class Q1PatternD {
public static void main(String[] args) {
for (int i = 1; i <= 6; i++)
{
for (int k = 2; k <= i; k++)
{
System.out.print(" ");
}
for (int j = i; j <= 6; j++)
{
System.out.print("*" + " ");
}
System.out.println();
}
}
}
// Developer : Muhammad Shazmi Bin Mohd Basri
// Task : Display Pattern A
public class PatternA {
public static void main (String [] args){
final int ROW = 6;
for (int i = 1; i <= ROW; i++) {
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
// Developer : Muhammad Shazmi Bin Mohd Basri
// Task : Display Pattern B
public class PatternB {
public static void main(String[] args) {
final int ROW = 1;
for (int i = 6; i >= ROW; i--) {
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
// Developer : Muhammad Shazmi Bin Mohd Basri
// Task : Display Pattern C
public class PatternC {
public static void main(String[] args) {
for(int i = 1; i <= 6; i++) {
for(int k = 1; k <= 6 - i; k++) {
System.out.print(" ");
}
for(int j = 1; j <= i; j++) {
System.out.print(" *");
}
System.out.println();
}
}
}
// Developer : Muhammad Shazmi Bin Mohd Basri
// Task : Display Pattern D
public class PatternD {
public static void main(String[] args) {
for(int i = 1; i <= 6; i++) {
for(int k = i; k > 1; k--) {
System.out.print(" ");
}
for(int j = 1; j <= 7 - i; j++) {
System.out.print(" *");
}
System.out.println();
}
}
}
// developer: arif qhuzairie
// task: nested loop 4 pattern
public class patterna {
public static void main(String[] args) {
int lines= 6;
for (int i = 1; i <= lines; i++) {
for (int j = 1; j <= i; j++) {
System.out.print(" * ");
}
System.out.println();
}
}
}
// developer: arif qhuzairie
// task: nested loop 4 pattern
public class patternb {
public static void main(String[] args) {
int lines = 6;
for (int i = lines; i >= 1; --i) {
for (int j = 1; j <= i; ++j) {
System.out.print("* ");
}
System.out.println();
}
}
}
// developer: arif qhuzairie
// task: nested loop 4 pattern
public class patternc {
public static void main(String[] args) {
final int lines = 6;
for (int i = 1; i <= lines; i++) {
for (int j = 1; j <= lines - i; j++) {
System.out.print(" ");
}
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println("");
}
}
}
// developer: arif qhuzairie
// task: nested loop 4 pattern
public class patternd {
public static void main(String[] args) {
int line =6;
for
(int i = 1; i <= 6; i++) {
for(int k = i; k > 1; k--) {
System.out.print(" ");
}
for(int h = 1; h <= 7 - i; h++) {
System.out.print(" *");
}
System.out.println();
}
}
}
//Developer: Ikmal Hafiq
//Task: Pattern A
public class PatternsA {
public static void main(String[] args) {
int lines= 6;
for (int i = 1; i <= lines; i++) {
for (int j = 1; j <= i; j++) {
System.out.print(" * ");
}
System.out.println();
}
}
}
//Developer: Ikmal Hafiq
// Task: Pattern B
public class PatternsB {
public static void main(String[] args) {
int lines = 6;
for (int i = lines; i >= 1; --i) {
for (int j = 1; j <= i; ++j) {
System.out.print("* ");
}
System.out.println();
}
}
}
// Developer: Ikmal Hafiq
// Task: Pattern C
public class PatternsC {
public static void main(String[] args) {
final int lines = 6;
for (int i = 1; i <= lines; i++) {
for (int j = 1; j <= lines - i; j++) {
System.out.print(" ");
}
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println("");
}
}
}
// Developer: Ikmal Hafiq
// Task: Pattern D
public class PatternsD {
public static void main(String[] args) {
int line =6;
for
(int i = 1; i <= 6; i++) {
for(int k = i; k > 1; k--) {
System.out.print(" ");
}
for(int h = 1; h <= 7 - i; h++) {
System.out.print(" *");
}
System.out.println();
}
}
}
/Developer:Lyana Azwanis
//Task: Display pattern A
public class Nestedloop1 {
public static void main(String[] args) {
for(int i = 1; i <= 6; i++) {
for(int j = 1; j <= i; j++) {
System.out.print(" * ");
}
System.out.println();
}
}
}
//Developer: Lyana Azwanis
//Task: Display pattern B
public class Nestedloop2 {
public static void main(String[] args) {
for(int i = 1; i <= 6; i++) {
for(int j = 1; j <= 7 - i; j++) {
System.out.print(" * ");
}
System.out.println();
}
}
}
//Developer: Lyana Azwanis
//Task: Display pattern C
public class Nestedloop3 {
public static void main(String[] args){
for (int i = 1; i <= 6; i++) {
for (int k = 1; k <= 6 - i; k++) {
System.out.print(" ");
}
for (int j = 1; j <= i; j++) {
System.out.print(" *");
}
System.out.println();
}
}
}
/Developer: Lyana Azwanis
//Task: Display pattern D
public class Nestedloop4 {
public static void main(String[] args) {
for(int i = 1; i <= 6; i++) {
for(int k = i; k > 1; k--) {
System.out.print(" ");
}
for(int j = 1; j <= 7 - i; j++) {
System.out.print(" *");
}
System.out.println();
}
}
}
package com.company;
//name: batrisya alwani
//task: patternA
public class Main {
public static void main(String[] args) {
for (int i = 1; i <= 6; i++) {
for (int j = 1; j <= i; j++) {
System.out.print(" * ");
}
System.out.println();
}
}
}
package com.company;
//name: batrisya alwani
//task: patternB
public class Main {
public static void main(String[] args) {
for(int i = 1; i <= 6; i++) {
for(int j = 1; j <= 7 - i; j++) {
System.out.print(" * ");
}
System.out.println();
}
}
}
package com.company;
//name: batrisya alwani
//task: patternC
public class Main {
public static void main(String[] args) {
for(int i = 1; i <= 6; i++) {
for(int k = 1; k <= 6 - i; k++) {
System.out.print(" ");
}
for(int j = 1; j <= i; j++) {
System.out.print(" *");
}
System.out.println();
}
}
}
package com.company;
//name: batrisya alwani
//task: patternD
public class Main {
public static void main(String[] args) {
for(int i = 1; i <= 6; i++) {
for(int k = i; k > 1; k--) {
System.out.print(" ");
}
for(int j = 1; j <= 7 - i; j++) {
System.out.print(" *");
}
System.out.println();
}
}
}
Question:
Submission: