could anyone point me in the right direction please. i have a small program to take a string input and then a number from the user and should then print on the screen a character from that string at the number postion the number of time of that number…if that makes sense… if i input qwertyuiop and the number 4 the display should read rrrr. so far i have the following to take the imput:
//get stringinput then check that it over 8 charaters//
mystring = window.prompt(‘enter a string of at least 8 characters’,”)
while (mystring.length <8)
{
mystring = window.prompt (“you must enter a string longer than 8 charaters”,”)
}
//get number//
anumber = window.prompt(“enter a number no larger than your string”,”)
//check length of number//
while (anumber>mystring.length)
(
anumber = window.prompt (“you must enter a number smaller than your string length”,”)
)
length = mystring.length
mystring = mystring.charAt(length)//
I can print out the length of the entered string but not the charAt(number) so that i can test the script is working up to that point.
cheers for any help you can give