0

hello everyone
could u please solve this for me
Write embedded JavaScript code in the required HTML tags that

accepts three numbers from the user and pring out the maximum as the following result :

First Number is : 3

Second Number is : 4

Third Number is : 5

The maximum number is : 5


this is my code which is not run with me

<html>
<head>
<title>
my first program
</title>
</head>
<SCRIPT LANGUAGE="java script">

{

var firstNumber;
var secondNumber;
var thiredNumber;
var max;
3=firstNumber;
4=secondNumber;
5=thiredNumber;

firstNumber=window.promp('please enter first number','');
firstNumber=parseFloat(firstNumber);


secondNumber=window.promp('please enter second number','');
secondNumber=parseFloat (secondNumber);




thiredNumber=window.promp('please enter thired number','');
thiredNumber=parseFloat(thiredNumber);


if (firstNumber>secondNumber)
{
max=firstNumber;
}
else

{
max=secondNumber;
}


if (thiredNumber>max)
{
max=thiredNumber;
}
document.write('The maximum number is'+max);


}


</SCRIPT>


</html>
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by girl.java
0

1: You don't need opening and closing brackets for the <script> tag(lines 9 and 51)

2: Can't assign to a number like "3=firstNumber;" (lines 15,16,17)

3: window.promp should be window.prompt (lines 19,23,29)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.