All pastes #587540 Raw Edit

Mine

public javascript v1 · immutable
#587540 ·published 2007-06-24 17:38 UTC
rendered paste body
<HTML><HEAD> <TITLE>Enter a number</TITLE></HEAD><BODY> M 150 TMA03 Question 1 (iii)(a)<SCRIPT type="text/javascript">var userWord;var userNumber;var userInput;var wordLength;var letterPos;var total;userWord = window.prompt('Please enter a word less than 8 characters', ' ');wordLength = userWord.lengthwhile ((wordLength < 8)){	userWord = window.prompt('Please re-enter the a word at least 8 chracters long' ,'')	wordLength = userWord.length};userInput = window.prompt('Please enter a number no more than ' + wordLength );userNumber = parseFloat(userInput);while ((userNumber > wordLength)){	userInput = window.prompt('Please re-enter a number no more than ' + wordLength );	userNumber = parseFloat(userInput);};letterPos = userWord.charAt(userNumber-1)for ( var count = 0; count userWord.length; count = count + 1 ){	if (userWord.charAt(count) == 'letterPos'	{	total = total + 1	}};document.write('<BR>'+'The Length of the word is ' + wordLength )document.write('<BR>'+'The Number entered is ' + userNumber )document.write('<BR>'+'The Letter at that position is ' + letterPos )document.write('<BR>'+'Total of those letters is ' + total )</SCRIPT></BODY></HTML>