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

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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): Lego Tower x 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, lego Height; private int baseLength; private Color[] colors; private Random rand = new Random(); Color prevColor;// = Color.yellow; public Lego Mania) { 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; lego Height = 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

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

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago