1 Attachment(s)
reached end of file while parsing- using bluej
Im completely new to programming and am trying to figure out where I went wrong on this project. the project is to write the code to draw this. I did it with the visual bench mark but cannot figure it out
Attachment 1764
Code:
public class Picture
{
private Square square1;
private Square square2;
private Circle circle1;
private Circle circle2;
private Circle circle3;
private Circle circle4;
private Triangle triangle1;
private Triangle triangle2;
}
public class Square
{
private int size;
private int xPosition;
private int yPosition;
private String color;
private boolean isVisible;
/**
* create a new square with arbitrary field values.
*/
public class Square {
{
size= theSize;
xPosition= xPosition;
yPosition= yPosition;
color= theColor;
if (theVisibility)
makeVisible();
else
makeInvisible();
}
public int square1()
{
theSize(200);
xPosition(50);
yPosition(55);
Color("black");
isVisible(true);
}
private square square2()
{
theSize(180);
xPosition(60);
yPosition(65);
Color("white");
isVisible(true);
}
public class triangle
{
private int size;
private int xPosition;
private int yPosition;
private String color;
private boolean isVisible;
}
public int Triangle();
{
int height = height;
int width = width;
int xPosition = xPosition;
int yPosition = yPosition;
string color = color;
int isVisible =(true);
}
Triangle triangle1;
{
height(110);
width(80);
xPosition(145);
yPosition(90);
color("black");
isVisible(true);
draw();
}
Triangle triangle2;
{
height(100);
width(70);
xPosition(145);
yPosition(96);
color("white");
isVisible(true);
}
public int Circle()
{
int diameter;
int xPosition;
int yPosition;
String color;
boolean isVisible;
}
private circle circle1;
{
diameter(150);
xPosition(70);
yPosition(80);
color("black");
boolean isVisible;
}
private circle circle2;
{
diameter(140);
xPosition(75);
yPosition(85);
color("white");
boolean isVisible;
}private circle circle3;
{
diameter(40);
xPosition(125);
yPosition(150);
color("black");
boolean isVisible;
}
private circle circle4;
{
diameter(30);
xPosition(130);
yPosition(155);
color("white");
boolean isVisible;
}
Re: reached end of file while parsing- using bluej
Count your curly brackets and see if they all match.
kind regards,
Jos