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):
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started