Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with a concept in my intro to computer science course. I have a class called myhouse which has a constructor with two

image text in transcribed

I need help with a concept in my intro to computer science course. I have a class called myhouse which has a constructor with two parameters (rectangle and triangle) that accepts two colors. I used super paint graphics g to draw only one house. I am now making a class called myhouse2 where I divided the JFrame into a 2x2 gridlayout. In this myhouse2 class, I need to use a loop to create an instance of the myhouse class for each row and column in the grid, utilizing random color for each isnstance. E.g. the loop creates 4 instances of the myhouse class and each part of the house is in a different color. Please note, I do not want you to provide code for the whole program. I just need help with the loop and random color part

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

More Books

Students also viewed these Databases questions