Question: Your goal is to create a program that prints the following figure. Your code should use loops (i.e. shouldnt just be five print statements, thats

Your goal is to create a program that prints the following figure. Your code should use loops (i.e. shouldnt just be five print statements, thats no fun).

* ** *** **** *****

I wrote a Java code but the computer reminds me that ''Error: cannot find symbol; symbol: variable col; location: class col''. Can someone help me in fixing it, please?

public class col { public static void main(String[] args) { col = col + 1; int col = 0; int row = 0; int SIZE = 5; row = row + 1; System.out.print('*'); System.out.println('*'); System.out.println(); while (col <= row) { while (col < row) { while (row < SIZE) { while (row <= SIZE) { } } } } } }

Thanks! Above is the code I wrote.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!