Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given this methode, public static void drawFlag(int stars, int stripes, java.awt.Graphics g, int x, int y, int width, int height) If I do, drawFlag(15,13,g,0,0,width/2,height/2) I

Given this methode,

public static void drawFlag(int stars, int stripes, java.awt.Graphics g, int x, int y, int width, int height)

If I do, drawFlag(15,13,g,0,0,width/2,height/2)

I will have 15 stars to draw on the flag...

Then, I made an algorithm to find a rectangular grid which I can draw stars in.

I will use 5 colums by 3 rows for the stars.

To draw stars, I will use drawStar(g,x,y,size)

Now using the nested for loops, How can i draw the stars ? given that I already know the size of the star.

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