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

The card below hides the image of a square, triangle, circle, or star. Concentra

ID: 3685333 • Letter: T

Question

The card below hides the image of a square, triangle, circle, or star. Concentrate on the hidden image, then dick on the corresponding button to make your guess. Statistics showing the number and percentage of correct guesses will appear in the boxes. Figure 11.14 Sample appearance of the enhanced ESP test page. Although you can create your own images for the cards, you can also use the images provided for you in the http://balance3e.com/Images directory. This directory contains images of four shapes-square.gi f, triangle, gif, circle.gi f, and star, gif-as well as mystery.gif, which display's the question mark. Using your esp.html page, test yourself for ESP. After 10 guesses, what is your percentage of correct guesses? After 20 guesses? After 50 guesses? How compelling do you find these percentages to be in deciding whether you have ESP? Justify your answer.

Explanation / Answer

Please find code for the same. Ensure that your source folder contains the specified images.

<html>
<head><title> ESP Test</title>
    

<script type="text/javascript">
var goodguess = 0, guess = 0;

function showImage(input)
{
alert("In function");               
var shape = Math.floor(Math.random() * 4) + 1 ;             
         
guess++;
if (input == shape)
{
goodguess++;
}  
    
if (shape == 1) {
    alert(shape);
    document.getElementById("image1").src = "square.gif";
}
else if (shape == 2) {
    alert(shape);
document.getElementById("image1").src = "circle.gif";
}
else if (shape == 3) {
    alert(shape);
document.getElementById("image1").src = "star.gif";
}
else if (shape== 4) {
    alert(shape);
document.getElementById("image1").src = "triangle.gif";
}
else
{
alert ("bye");
}


document.getElementById("CorrectcountBox").value = goodguess;
    
document.getElementById("TotalCountBox").value = guess;
     
document.getElementById("numGuessBox").value = Math.Int((goodguess/guess) * 100); // Percent;
     

}   
</script>
</head>

<body>
   
  
   <h1 align="Center">ESP Test</h1>
    <h2 align="center">Measure your Extrasensory Perception</h2>

    <p align="center">


            The card below hides the image of a square, triangle, circle, or star.<br />        
Concentrate on the hidden image, then click on the corresponding button to make your guess.
    </p>
    <br />
    <p align="center">         
Statistics showing the number and percentage of correct guesses will appear in the boxes.
    </p>
    <hr />
   
    <div>


                          
     <form>
     <input type="button" value="Square" id="mystery" />
     <input type="button" value="Triangle" id="mystery"/>
     <input type="button" value="Circle" id="mystery"/>
     <input type="button" value="Star" id="mystery"/>
     <br />
     <p>
     <img alt="question mark" src=mystery.gif" id="image1" />
  
     </p>
            You have guessed correctly <input type="text" id="CorrectcountBox" size="10" value="0" /> out of <input type="text" id="TotalCountBox" size="10" value="0" /> times.

    
     <br />
  

            That means you were correct<input type="text" id="numGuessBox" size="10" value="0" />% of the time

  
   
    </form>
   </div>
</body>
</html>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote