var Circle = function() { this.x = 0; this.y = 0; this.radius = 0; this.setRadius = function(r) { this.radius = r; } this.setCoords = function(x,y) { this.x = x; this.y = y; } this.report = function() { alert("I am a Circle with a radius of " + this.radius + " and which sits at co-ordinates " + this.x + ", " + this.y + "."); } } var Rectangle = function() { this.x1 = 0; this.y1 = 0; this.x2 = 0; this.y2 = 0; this.setCoords = function(x1,y1,x2,y2) { this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; } this.report = function() { alert("I am a Rectangle which sits at co-ordinates (" + this.x1 + ", " + this.y1 + ") are (" + this.x2 + ", " + this.y2 + ")."); } } var rectangle1 = new Rectangle(); rectangle1.setCoords(0,0,30,40); var circle1 = new Circle(); circle1.setRadius(9); circle1.setCoords(30,30);