Draw a Circle With Radius Using 2d Array

#1

  • D.I.C Caput

Reputation: 1

  • View blog
  • Posts: 57
  • Joined: 02-June 11

drawing a filled rectangle/circumvolve in a 2d array

Posted 16 October 2011 - 07:04 PM

Hey, I'1000 having problems writing methods rectangle and circle that draws a filled rectangle and circle respectively.
This programme is supposed to create a class Film which includes methods Picture(int rmax, int cmax, char background) which draws the board, print() which prints the receiving pic, rectangle(int rlo, int rhi, int clo, int chi, char color) which draws a filled rectangle in the 2d array where rlo, rhi, clo, chi ascertain the corners of the rectangle and color is the character to put in teach pixel of the rectangle, method circle(double rc, double cc, double radius, char color) draws a filled circumvolve in a 2d assortment where (rc,cc) is the middle radius is the radius and color is the graphic symbol to put in each pixel of the circle.
in the circle method we are supposed to use a an algorithm that considers every pixel (r,c) in the array and if the distance from (r,c) to (rc,cc) is less than or equal to radius and then give information technology the specified color. after all that we write a driver which tests the class.
i know you won't practice my homework for me, im simply a bit confused on what needs to be done

the code i have and so far
I'm not quite sure i did the circle method correctly
i tried compiling what i had and it gives me
Main.java:25: cannot detect symbol
symbol : variable rmax
location: class Picture
for (int row = 0; row < rmax; row++)
^
Main.java:27: cannot detect symbol
symbol : variable cmax
location: grade Picture
for (int col = 0; col < cmax; col++)
^
Main.java:39: cannot find symbol
symbol : variable rmax
location: class Picture
for(int row = 0; row < rmax; row++)
^
Principal.java:41: cannot find symbol
symbol : variable cmax
location: course Picture
for(int col = 0; col < cmax; col++)
^
Main.java:53: cannot notice symbol
symbol : constructor Flick(char[][])
location: form Motion-picture show
return new Picture(result);
^
Main.coffee:58: cannot observe symbol
symbol : variable row
location: class Motion picture
double d = Math.sqrt((rc-row)(rc-row)+(cc-col)(cc-col));
^
Master.java:58: unexpected type
required: class
found : value
double d = Math.sqrt((rc-row)(rc-row)+(cc-col)(cc-col));
^
Main.java:58: cannot find symbol
symbol : variable row
location: class Picture
double d = Math.sqrt((rc-row)(rc-row)+(cc-col)(cc-col));
^
Main.java:58: cannot notice symbol
symbol : variable col
location: class Picture
double d = Math.sqrt((rc-row)(rc-row)+(cc-col)(cc-col));
^
Main.coffee:58: unexpected type
required: class
institute : value
double d = Math.sqrt((rc-row)(rc-row)+(cc-col)(cc-col));
^
Main.coffee:58: cannot find symbol
symbol : variable col
location: course Picture
double d = Math.sqrt((rc-row)(rc-row)+(cc-col)(cc-col));
^
Main.java:58: sqrt(double) in java.lang.Math cannot be applied to (coffee.lang.String)
double d = Math.sqrt((rc-row)(rc-row)+(cc-col)(cc-col));
^
Master.java:61: cannot notice symbol
symbol : variable rmax
location: class Picture
for(int row = 0; row < rmax; row++)
^
Main.java:63: cannot find symbol
symbol : variable cmax
location: class Picture
for(int col =0; col < cmax; col++)
^
Main.coffee:71: cannot detect symbol
symbol : constructor Motion-picture show(char[][])
location: form Picture
return new Picture(circle);
^

// Written by  // //  // import java.io.*; import java.util.Scanner; //////////////////////////////////////////////////////////////////////////// class Film {    private char[][]a; //--------------------------------------------------------------------------    public Film(int rmax, int cmax, char background)    {       for(int row = 0; row < rmax; row ++)       {          for(int col = 0; col < cmax; col++)          {             a[row][col] = background;          }       }      } //--------------------------------------------------------------------------    public Picture print() // seperate method to impress the other classes    {       for (int row = 0; row < rmax; row++)       {          for (int col = 0; col < cmax; col++)          {             Organisation.out.print(a[row][col] + " ");          }          System.out.println();       }    } //--------------------------------------------------------------------------    public Moving-picture show Rectangle(int rlo, int rhi, int clo, int chi, char color)     {       char[][] outcome = new char[a.length][a.length];        for(int row = 0; row < rmax; row++)       {          for(int col = 0; col < cmax; col++)          {             if(row >= rlo && row <= rhi)             {                event[row][col] = color;             }             if(col >= clo && row <= chi)             {                result[row][col] = color;             }          }       }       return new Motion picture(result);      }   //--------------------------------------------------------------------------    public Picture Circle (double rc, double cc, double radius, char color)    {       double d = Math.sqrt((rc-row)(rc-row)+(cc-col)(cc-col));       char[][] circumvolve = new char[a.length][a.length];        for(int row = 0; row < rmax; row++)       {          for(int col =0; col < cmax; col++)          {             if(d <= radius)             {                circle[row][col] = color;             }          }       }       return new Flick(circumvolve);    } //-------------------------------------------------------------------------- } // stop class Picture //////////////////////////////////////////////////////////////////////////// // driver that tests class, ignore for now lol class Hw08 { //--------------------------------------------------------------------------    public static void main ( String [] args ) throws Exception    {       Picture show p = new Picture (l,50," ");       p.impress();       p.rectangle(x,twenty,10,20,'x');       p.print();       p.circumvolve(thirty,xxx,10,"o");    } //-------------------------------------------------------------------------- } // stop class Hw08 ////////////////////////////////////////////////////////////////////////////            

This post has been edited by BlahBlahMan: xvi October 2011 - 07:ten PM


Is This A Skillful Question/Topic? 0

  • +

#two macosxnerd101 User is offline

Reputation: 12800

  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: drawing a filled rectangle/circle in a 2d assortment

Posted 16 October 2011 - 07:12 PM

Remember that when you accept methods with parameters, those parameters are only attainable inside that method. So here public Film(int rmax, int cmax, char background), rmax and cmax are parameters. Y'all cannot use them outside of this constructor. However, in a two-dimensional assortment a.length returns the number of rows, and a[someIndex].length returns the number of elements (columns) for the array at someIndex.

Quote

Main.java:53: cannot observe symbol
symbol : constructor Film(char[][])
location: class Picture
return new Picture(event);
^

You didn't ascertain a constructor to accept a char[][].

Hither, you have to explicitly multiply the expressions in the parentheses together using the * operator.

double d = Math.sqrt((rc-row)(rc-row)+(cc-col)(cc-col));            

Those should business relationship for a lot of your errors.

#3 mastrgamr User is offline

  • New D.I.C Caput

Reputation: 2

  • View blog
  • Posts: 18
  • Joined: 30-December ten

Re: drawing a filled rectangle/circle in a 2nd array

Posted 16 October 2011 - 07:24 PM

Your code is all wrong, you dont have a Picture constructor that assigns all the arrays items to whatever you pass to information technology.

You declare methods of blazon Picture but don't return pic.

In your driver yous pass a string, when y'all declared a char. So yous need to modify that.

#4 BlahBlahMan User is offline

  • D.I.C Head

Reputation: 1

  • View blog
  • Posts: 57
  • Joined: 02-June xi

Re: drawing a filled rectangle/circumvolve in a 2d assortment

Posted 16 October 2011 - 07:44 PM

im a bit confused on how to practice the constructor for 2d arrays

wouuld i do something like this?

              public Picture(char rmax, char cmax, char background)    {       a = new char [rmax][cmax]       for(int row = 0; row < rmax; row ++)       {          for(int col = 0; col < cmax; col++)          {             a[row][col] = groundwork;          }       }      }            

revised code beneath without ^

// Written by  // // description of this program // import coffee.io.*; import java.util.Scanner; //////////////////////////////////////////////////////////////////////////// course Film {    private char[][]a;    private int i; //--------------------------------------------------------------------------    public Moving-picture show(int rmax, int cmax, char groundwork)    {       a = new char [rmax][cmax]       for(int row = 0; row < rmax; row ++)       {          for(int col = 0; col < cmax; col++)          {             a[row][col] = groundwork;          }       }      } //--------------------------------------------------------------------------    public Moving-picture show print() // seperate method to impress the other classes    {       for (int row = 0; row < a.length; row++)       {          for (int col = 0; col < a[i].length; col++)          {             Organisation.out.print(a[row][col] + " ");          }          Organization.out.println();       }    } //--------------------------------------------------------------------------    public Motion-picture show Rectangle(int rlo, int rhi, int clo, int chi, char color)     {       char[][] consequence = new char[a.length][a.length];        for(int row = 0; row < a.length; row++)       {          for(int col = 0; col < a[i].length; col++)          {             if(row >= rlo && row <= rhi)             {                result[row][col] = color;             }             if(col >= clo && row <= chi)             {                result[row][col] = color;             }          }       }       return Picture(outcome);      }   //--------------------------------------------------------------------------    public Picture Circle (double rc, double cc, double radius, char colour)    {       char[][] circle = new char[a.length][a.length];        for(int row = 0; row < a.length; row++)       {          for(int col = 0; col < a[i].length; col++)          {             double d = Math.sqrt((rc-row)*(rc-row)+(cc-col)*(cc-col));             if(d <= radius)             {                circle[row][col] = colour;             }          }       }       return Picture(circle);    } //-------------------------------------------------------------------------- } // cease class Moving-picture show //////////////////////////////////////////////////////////////////////////// // commuter that tests class, ignore for now lol grade Hw08 { //--------------------------------------------------------------------------    public static void chief ( char [][] args ) throws Exception    {       Picture p = new Picture (50,50," ");       p.impress();       p.Rectangle(10,xx,10,twenty,'10');       p.print();       p.Circle(30,30,10,"o");    } //-------------------------------------------------------------------------- } // end grade Hw08 ////////////////////////////////////////////////////////////////////////////            

This post has been edited by BlahBlahMan: 16 Oct 2011 - 07:55 PM

#5 macosxnerd101 User is offline

Reputation: 12800

  • View blog
  • Posts: 45,992
  • Joined: 27-Dec 08

Re: drawing a filled rectangle/circumvolve in a 2d array

Posted 16 October 2011 - 07:57 PM

Here, find how the param is a char[][]. Then I assign the param to the instance field.

public Flick(char[][] a){     this.a = a; }            

#six BlahBlahMan User is offline

  • D.I.C Caput

Reputation: 1

  • View blog
  • Posts: 57
  • Joined: 02-June 11

Re: cartoon a filled rectangle/circle in a 2nd array

Posted 16 October 2011 - 08:02 PM

View Postmacosxnerd101, on 16 October 2011 - 07:57 PM, said:

Here, observe how the param is a char[][]. Then I assign the param to the instance field.

public Picture(char[][] a){     this.a = a; }              

so a constructor that would work would be something like this?

              public Picture(char[][] a)    {       this.rmax = rmax;       this.cmax = cmax;       this.background = background;       this.a = new char [rmax][cmax];       for(int row = 0; row < rmax; row ++)       {          for(int col = 0; col < cmax; col++)          {             a[row][col] = background;          }       }      }            

This post has been edited by BlahBlahMan: 16 October 2011 - 08:ten PM

#7 BlahBlahMan User is offline

  • D.I.C Caput

Reputation: 1

  • View blog
  • Posts: 57
  • Joined: 02-June 11

Re: drawing a filled rectangle/circle in a 2d array

Posted 16 October 2011 - 09:53 PM

revised code, still confused >.<
getting these errors
Main.java:123: cannot find symbol
symbol : method Film(int,int,java.lang.String)
location: class Hw08
Moving picture p = Picture show(l,l," ");
^
Main.java:125: rectangle(int,int,int,int,char) in Moving-picture show cannot be applied to (int,int,int,int,java.lang.String)
p.rectangle(10,twenty,10,20,"ten");
^
Main.java:127: circle(double,double,double,char) in Film cannot be applied to (int,int,int,coffee.lang.String)
p.circumvolve(xxx,30,10,"o");
^
3 errors

// Written past  // // description of this program // import java.io.*; import java.util.Scanner; //////////////////////////////////////////////////////////////////////////// form Flick {    individual char[][]a;    private int i;    private int rmax;    private int cmax;    private char background;    private double rc;    private double cc;    private double radius;    private char color; //--------------------------------------------------------------------------    public Picture(int rmax, int cmax, char groundwork)    {       this.rmax = rmax;       this.cmax = cmax;       this.background = background;       this.a = new char [rmax][cmax];       for(int row = 0; row < rmax; row ++)       {          for(int col = 0; col < cmax; col++)          {             a[row][col] = groundwork;          }       }     } //--------------------------------------------------------------------------    public Picture(char[][] a)    {       this.rmax = rmax;       this.cmax = cmax;       this.background = background;       this.a = new char [rmax][cmax];       for(int row = 0; row < rmax; row ++)       {          for(int col = 0; col < cmax; col++)          {             a[row][col] = background;          }       }    } //--------------------------------------------------------------------------    public Picture(double rc, double cc, double radius, char color)    {       this.rc = rc;       this.cc = cc;       this.radius = radius;       this.color = color;       for(int row = 0; row < rmax; row ++)       {          for(int col = 0; col < cmax; col++)          {             a[row][col] = color;          }       }    } //--------------------------------------------------------------------------    public void print() // seperate method to print the other classes    {       for (int row = 0; row < a.length; row++)       {          for (int col = 0; col < a[i].length; col++)          {             System.out.print(a[row][col] + " ");          }          System.out.println();       }    } //--------------------------------------------------------------------------    public Picture show rectangle(int rlo, int rhi, int clo, int chi, char color)     {       char[][] upshot = new char[a.length][a.length];        for(int row = 0; row < a.length; row++)       {          for(int col = 0; col < a[i].length; col++)          {             if(row >= rlo && row <= rhi)             {                issue[row][col] = color;             }             if(col >= clo && row <= chi)             {                result[row][col] = color;             }          }       }       render new Picture(upshot);      }   //--------------------------------------------------------------------------    public Picture circle (double rc, double cc, double radius, char color)    {       char[][] circumvolve = new char[a.length][a.length];        for(int row = 0; row < a.length; row++)       {          for(int col = 0; col < a[i].length; col++)          {             double d = Math.sqrt((rc-row)*(rc-row)+(cc-col)*(cc-col));             if(d <= radius)             {                circle[row][col] = color;             }          }       }       render new Picture(circle);    } //-------------------------------------------------------------------------- } // stop class Picture //////////////////////////////////////////////////////////////////////////// class Hw08 { //--------------------------------------------------------------------------    public static void main ( char [][] args ) throws Exception    {       Flick p = Picture(50,50," ");       p.print();       p.rectangle(10,20,10,20,"ten");       p.print();       p.circle(30,30,10,"o");    } //-------------------------------------------------------------------------- } // end class Hw08 ////////////////////////////////////////////////////////////////////////////            

#8 macosxnerd101 User is offline

Reputation: 12800

  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: drawing a filled rectangle/circle in a 2d array

Posted 16 Oct 2011 - 09:55 PM

For your mail service about the constructor, this a[row][col] = background; deals with the param, not the instance variable this.a.

For your second set of errors, chars are surrounded by unmarried quotes, and Strings by double quotes.

char x = 'ten'; String y = "y";            

#9 BlahBlahMan User is offline

  • D.I.C Caput

Reputation: 1

  • View blog
  • Posts: 57
  • Joined: 02-June 11

Re: drawing a filled rectangle/circle in a 2d array

Posted sixteen October 2011 - 10:10 PM

View Postmacosxnerd101, on sixteen October 2011 - 09:55 PM, said:

For your post about the constructor, this a[row][col] = groundwork; deals with the param, not the instance variable this.a.

For your second set of errors, chars are surrounded by single quotes, and Strings by double quotes.

char x = 'ten'; String y = "y";              

so i fixed the second gear up of errors, but I'k still very confused about the constructor what exercise yo mean by a[row][col] = background; deals with the param and not the instance variable? can you provide an example?
thank you for your help and then far!

This post has been edited by BlahBlahMan: 16 October 2011 - 10:12 PM

#10 macosxnerd101 User is offline

Reputation: 12800

  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: cartoon a filled rectangle/circle in a second array

Posted 16 October 2011 - 10:13 PM

Quote

public Picture(char[][] a)

This variable a is a parameter. It is local to the method. Since you also have an instance variable named a, the parameter takes precedence in the method. So when y'all refer to a[row][col] = background;, you lot are modifying the parameter- a local variable. When the constructor telephone call is completed, the instance variable will not be modified. If you assign this.a[row][col] = background;, the data will be saved in the case variable.

#xi BlahBlahMan User is offline

  • D.I.C Head

Reputation: ane

  • View blog
  • Posts: 57
  • Joined: 02-June 11

Re: drawing a filled rectangle/circumvolve in a 2nd array

Posted 16 October 2011 - 10:32 PM

View Postmacosxnerd101, on 16 October 2011 - x:13 PM, said:

Quote

public Moving-picture show(char[][] a)

This variable a is a parameter. It is local to the method. Since you as well take an example variable named a, the parameter takes precedence in the method. Then when you lot refer to a[row][col] = background;, you are modifying the parameter- a local variable. When the constructor telephone call is completed, the instance variable will not be modified. If y'all assign this.a[row][col] = background;, the information will be saved in the instance variable.

I kind of get what you are proverb, but how come up the mistake just pops upwards in the first constructor?

#12 BlahBlahMan User is offline

  • D.I.C Head

Reputation: one

  • View blog
  • Posts: 57
  • Joined: 02-June eleven

Re: drawing a filled rectangle/circle in a 2d assortment

Posted 16 October 2011 - 11:03 PM

revised code, still getting mistake
Main.coffee:123: cannot detect symbol
symbol : method Picture(int,int,char)
location: class Hw08
Picture p = Picture(50,50,' ');
^
one error

// Written past Steve Nham // // description of this plan // import java.io.*; import java.util.Scanner; //////////////////////////////////////////////////////////////////////////// class Motion picture {    private char[][]a;    private int i;    private int rmax;    private int cmax;    individual char background;    private double rc;    individual double cc;    private double radius;    private char color; //--------------------------------------------------------------------------    public Moving picture(int rmax, int cmax, char background)    {       this.rmax = rmax;       this.cmax = cmax;       this.background = background;       this.a = a;       for(int row = 0; row < rmax; row ++)       {          for(int col = 0; col < cmax; col++)          {             this.a[row][col] = groundwork;          }       }     } //--------------------------------------------------------------------------    public Movie(char[][] a)    {       this.rmax = rmax;       this.cmax = cmax;       this.background = background;       this.a = a;       for(int row = 0; row < rmax; row ++)       {          for(int col = 0; col < cmax; col++)          {             this.a[row][col] = background;          }       }    } //--------------------------------------------------------------------------    public Picture(double rc, double cc, double radius, char color)    {       this.rc = rc;       this.cc = cc;       this.radius = radius;       this.color = color;       for(int row = 0; row < rmax; row ++)       {          for(int col = 0; col < cmax; col++)          {             this.a[row][col] = color;          }       }    } //--------------------------------------------------------------------------    public void print()    {       for (int row = 0; row < a.length; row++)       {          for (int col = 0; col < a[i].length; col++)          {             System.out.print(a[row][col] + " ");          }          System.out.println();       }    } //--------------------------------------------------------------------------    public Picture rectangle(int rlo, int rhi, int clo, int chi, char color)     {       char[][] consequence = new char[a.length][a.length];        for(int row = 0; row < a.length; row++)       {          for(int col = 0; col < a[i].length; col++)          {             if(row >= rlo && row <= rhi)             {                outcome[row][col] = color;             }             if(col >= clo && row <= chi)             {                result[row][col] = colour;             }          }       }       return new Picture(result);      }   //--------------------------------------------------------------------------    public Picture circle (double rc, double cc, double radius, char color)    {       char[][] circle = new char[a.length][a.length];        for(int row = 0; row < a.length; row++)       {          for(int col = 0; col < a[i].length; col++)          {             double d = Math.sqrt((rc-row)*(rc-row)+(cc-col)*(cc-col));             if(d <= radius)             {                circle[row][col] = color;             }          }       }       return new Picture(circle);    } //-------------------------------------------------------------------------- } // end class Film //////////////////////////////////////////////////////////////////////////// form Hw08 { //--------------------------------------------------------------------------    public static void main ( char [][] args ) throws Exception    {       Moving-picture show p = Picture(l,50,' ');       p.print();       p.rectangle(10,20,10,20,'10');       p.print();       p.circle(xxx,30,ten,'o');    } //-------------------------------------------------------------------------- } // stop class Hw08 ////////////////////////////////////////////////////////////////////////////            

#xiii BlahBlahMan User is offline

  • D.I.C Head

Reputation: 1

  • View blog
  • Posts: 57
  • Joined: 02-June 11

Re: drawing a filled rectangle/circumvolve in a 2d array

Posted 16 October 2011 - 11:23 PM

Now i get a

Exception in thread "main" java.lang.NoClassDefFoundError: Main Acquired past: java.lang.ClassNotFoundException: Principal 	at java.cyberspace.URLClassLoader$1.run(URLClassLoader.java:200) 	at coffee.security.AccessController.doPrivileged(Native Method) 	at java.cyberspace.URLClassLoader.findClass(URLClassLoader.coffee:188) 	at java.lang.ClassLoader.loadClass(ClassLoader.coffee:303) 	at lord's day.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) 	at java.lang.ClassLoader.loadClass(ClassLoader.coffee:248) 	at java.lang.ClassLoader.loadClassInternal(ClassLoader.coffee:316) Could not find the primary class: Main. Programme will exit.            

// Written by Steve Nham // // description of this programme // import coffee.io.*; import java.util.Scanner; //////////////////////////////////////////////////////////////////////////// form Picture {    private char[][]a;    private int i;    private int rmax;    private int cmax;    private char background;    private double rc;    individual double cc;    private double radius;    private char color; //--------------------------------------------------------------------------    public Picture(int rmax, int cmax, char background)    {       this.rmax = rmax;       this.cmax = cmax;       this.groundwork = background;       this.a = a;       for(int row = 0; row < rmax; row++)       {          for(int col = 0; col < cmax; col++)          {             this.a[row][col] = groundwork;          }       }     } //--------------------------------------------------------------------------    public Picture(char[][] a)    {       this.rmax = rmax;       this.cmax = cmax;       this.background = background;       this.a = a;       for(int row = 0; row < rmax; row++)       {          for(int col = 0; col < cmax; col++)          {             this.a[row][col] = background;          }       }    } //--------------------------------------------------------------------------    public Picture(double rc, double cc, double radius, char color)    {       this.rc = rc;       this.cc = cc;       this.radius = radius;       this.color = colour;       for(int row = 0; row < rmax; row++)       {          for(int col = 0; col < cmax; col++)          {             this.a[row][col] = color;          }       }    } //--------------------------------------------------------------------------    public void print()    {       for (int row = 0; row < a.length; row++)       {          for (int col = 0; col < a[i].length; col++)          {             System.out.print(a[row][col] + " ");          }          System.out.println();       }    } //--------------------------------------------------------------------------    public Movie rectangle(int rlo, int rhi, int clo, int chi, char color)     {       char[][] upshot = new char[a.length][a.length];        for(int row = 0; row < a.length; row++)       {          for(int col = 0; col < a[i].length; col++)          {             if(row >= rlo && row <= rhi)             {                event[row][col] = color;             }             if(col >= clo && row <= chi)             {                result[row][col] = color;             }          }       }       render new Pic(result);      }   //--------------------------------------------------------------------------    public Picture circle (double rc, double cc, double radius, char color)    {       char[][] circle = new char[a.length][a.length];        for(int row = 0; row < a.length; row++)       {          for(int col = 0; col < a[i].length; col++)          {             double d = Math.sqrt((rc-row)*(rc-row)+(cc-col)*(cc-col));             if(d <= radius)             {                circumvolve[row][col] = colour;             }          }       }       return new Pic(circle);    } //-------------------------------------------------------------------------- } // finish class Picture //////////////////////////////////////////////////////////////////////////// form Hw08 { //--------------------------------------------------------------------------    public static void principal ( char [][] args ) throws Exception    {       Picture p = new Picture(50,l,' ');       p.print();       p.rectangle(10,twenty,ten,twenty,'x');       p.impress();       p.circle(30,30,10,'o');    } //-------------------------------------------------------------------------- } // finish class Hw08 ////////////////////////////////////////////////////////////////////////////            

#14 smohd User is offline

Reputation: 1825

  • View blog
  • Posts: 4,627
  • Joined: 14-March 10

Re: drawing a filled rectangle/circle in a 2d array

Posted 16 October 2011 - xi:30 PM

The grade with main() should exist public and the file should be saved by its name. And so class Hw08, is the ane to be public and a file name will exist Hw08.coffee

#15 BlahBlahMan User is offline

  • D.I.C Head

Reputation: ane

  • View blog
  • Posts: 57
  • Joined: 02-June 11

Re: drawing a filled rectangle/circumvolve in a second array

Posted 16 Oct 2011 - 11:33 PM

View Postsmohd, on 16 October 2011 - xi:thirty PM, said:

The class with main() should be public and the file should exist saved past its proper name. So class Hw08, is the 1 to be public and a file name will exist Hw08.java

but isnt this public already? and the file name is Hw08.coffee

//////////////////////////////////////////////////////////////////////////// class Hw08 { //--------------------------------------------------------------------------    public static void principal ( char [][] args ) throws Exception    {       Moving picture p = new Picture(50,50,' ');       p.print();       p.rectangle(10,20,10,xx,'ten');       p.impress();       p.circle(xxx,30,10,'o');    } //-------------------------------------------------------------------------- } // end class Hw08 ////////////////////////////////////////////////////////////////////////////            

burgesstwerefy.blogspot.com

Source: https://www.dreamincode.net/forums/topic/251602-drawing-a-filled-rectanglecircle-in-a-2d-array/

0 Response to "Draw a Circle With Radius Using 2d Array"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel