Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Need help with javascript plzzz!

Im new here and to JS and am having a hard time with JS. I really wanna learn this stuff so i can ace this class but my teacher jumps into material without explaining it enough.
Goal of this program is to accept 30 characters individually from the user and display how many times each of 5 vowels are entered (a,e,i,o,u) and to display it. I made 5 counters and set up everything and have wasted 2 hours fumbling around with it and cant figure out why final screen always reads 0 for each vowel.
This is what i have now... (charin being character in) someone plzz help me!!!
<script>
var charin= new Array(30);
var countA=0;
var countE=0;
var countI=0;
var countO=0;
var countU=0;
var a;
var e;
var i;
var o;
var u;
var x=0;
for(x=0;x<30;++x)
{
charin[x]=prompt("Enter Character:");
charin[x]=eval(charin[x])
{
if(charin[x]=a)
countA=countA+1
}
if (charin[x]=e)
{
countE=countE+1;
}
if (charin[x]=i)
{
countI=countI+1;
}
if (charin[x]=o)
{
countO=countO+1;
}
if (charin[x]=u)
{
countU=countU+1;
}
}
document.write("Number of A:"+countA+"<p>")
document.write("Number of E:"+countE+"<p>")
document.write("Number of I:"+countI+"<p>")
document.write("Number of O:"+countO+"<p>")
document.write("Number of U:"+countU+"<p>")
</script>
[1502 byte] By [Bojangles69] at [2007-11-11 8:07:23]
# 1 Re: Need help with javascript plzzz!
Here is for you.!

<script>
var intBound = 30;

var charin= new Array(intBound);

var countA=0;
var countE=0;
var countI=0;
var countO=0;
var countU=0;

var strA = "a";
var strE = "e";
var strI = "i";
var strO = "o";
var strU = "u";

var x=0;

for(x=0;x<intBound;x++)
{
charin[x]=prompt("Enter Character:");

if(charin[x]==strA)
countA++;
else if(charin[x]==strE)
countE++;
else if(charin[x]==strI)
countI++;
else if(charin[x]==strO)
countO++;
else if(charin[x]==strU)
countU++;
}

//Displaying the result.
document.write("Number of A :" + countA +"<br>")
document.write("Number of E :" + countE +"<br>")
document.write("Number of I :" + countI +"<br>")
document.write("Number of O :" + countO +"<br>")
document.write("Number of U :" + countU +"<br>")

</script>
Sync at 2007-11-11 23:34:49 >
# 2 Re: Need help with javascript plzzz!
/\ /\ Thank you soooo much, i desperately need a tutor like you. You have clarified so much for me. :D
Bojangles69 at 2007-11-11 23:35:55 >
# 3 Re: Need help with javascript plzzz!
You are welcome. Bojangles69.
Sync at 2007-11-11 23:36:53 >