Question: There are 10 total errors in this code and 2 of them involve code that has no point to them and does not alter the

There are 10 total errors in this code and 2 of them involve code that has no point to them and does not alter the way the program is executed. 4 of them are spelling errors. So that is 6 is total so far. Need to know what the correct code is.

Correctly Debugged file output (colors will not be the same but that is alright):

There are 10 total errors in this code and 2 of them package lego.mania;

import java.awt.Color; import java.awt.Graphics; import java.util.Random; import javax.swing.JFrame;

@SuppressWarnings("serial") public class LegoMania extends JFrame { private int startX, startY; private int legoWidth, legoHeight; private int baseLength; private Color[] colors; private Random rand = new Random(); Color prevColor;// = Color.yellow; public LegoMania() { super("Lego Tower"); colors = new Color[]{Color.red, Color.blue, Color.yellow, Color.green, Color.pink, Color.black, Color.magenta, Color.orange, Color.cyan} rand = new Random(); startX = 20; startY = 300; legoWidth = 50; legoHeight = 20; baseLength = 5; } public void paint(Graphics g) { int currentX = startX, currentY = startY; int len = baseLength; // Draw pattern for each row while (len > 0) { // Finish the pattern in each row for (int col = 0; col

}

l Lego lower l Lego lower

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!