a pastebin project

Exercise 4.29

  1. public class Star
  2. {
  3.         public boolean space=false;
  4.         public void MakeStar()
  5.         {
  6.                 for (int y=0;y<8;y++)
  7.                 {
  8.                 if (space==true)
  9.                 {
  10.                         System.out.print(" ");
  11.                         space=false;
  12.                 }
  13.                 else
  14.                 {
  15.                         space=true;
  16.                 }
  17.                 for (int i=0;i<8;i++)
  18.                 {
  19.                         System.out.print("* ");
  20.                 }
  21.                 System.out.println("");
  22.                 }
  23.         }
  24.        
  25.  
  26.  
  27.         public static void main(String argv[])
  28.         {
  29.                 Star star = new Star();
  30.                 star.MakeStar();
  31.         }
  32. }

advertising

Create a Paste

Please enter your new post below (or upload a file instead):





Please note that information posted here will not expire by default. If you want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords.

fantasy-obligation
fantasy-obligation