Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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):

image text in transcribed 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions

Question

2. What is the impact of information systems on organizations?

Answered: 1 week ago

Question

Evaluate the impact of technology on HR employee services.

Answered: 1 week ago