Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

BIS2523 Homework Assignments 2.5 Assignment #5-Shell Game Folder: hw06 Overview:

ID: 3595453 • Letter: B

Question

BIS2523 Homework Assignments 2.5 Assignment #5-Shell Game Folder: hw06 Overview: This program uses 3 images, "cup.jpg" is a cup in the down' position, "empty.jpg" is a cup lifted up, with nothing under it and "ball.jpg", which is a lifted cup with a ball under it. These image files are available on the K: drive. he following PHP will generate a web page with 3 pictures of the cup. One of the images will have an ID tag of "ball", the other two will have the class called "empty". $ cup = rand ( 1 , 3) ; for ($i = 1; Si

Explanation / Answer

<html>

<head>

<script language="javascript">

var x=new Array();

x[0]=new Image();

x[0].src="cup.jpg";

x[1]=new Image();

x[1].src="empty.jpg";

x[2]=new Image();

x[2].src="ball.jpg";

function show1()

{

document.getElementById(" ball ").src=x[0].src;

}

function show2()

{

document.getElementById(" ball ").src=x[1].src;

}

function show3()

{

document.getElementById(" ball ").src=x[2].src;

}

</script>

</head>

<body>

<img src="cup.jpg" id="ball" width=200 height=200

onMouseOver="show2()"

onMouseOut="show3()">

</body>

</html>