I am fairly new to JavaScript and have enrolled in an online class. For my fourth project, I created a JavaScript that calculates the user's grade point average.
- <!-- m --><a class="postlink" href="http://members.cox.net/acrappa/javascript/project4.html">http://members.cox.net/acrappa/javascript/project4.html</a><!-- m -->
For this week's project, my instructor has challenged the class to accomplish the same task but with using a function. The function is used to convert the letter grade to a number (A=4, B=3, etc.). I haven't finished this yet, but here's my work in progress:
- <!-- m --><a class="postlink" href="http://members.cox.net/acrappa/javascript/project5prog.html">http://members.cox.net/acrappa/javascri ... 5prog.html</a><!-- m -->
Something is causing an error in my function. I know that I've properly called it, but something is not right. For every class that is entered, the default in the 'switch' reports the 'default' error. That is, instead of converting three grades to three numbers, the default message displays three times telling the user to use proper formatting.
I'm not sure if my problem is the way I'm using a 'switch' in the function or if something is setup wrong.
I don't want and am not encouraging a flat-out answer for this. I'm hoping that someone here who is experienced with JavaScript can point me out to what I'm doing wrong in which portion of code. Hopefully I can figure it out myself, but right now I'm a bit stuck.
Help me, journeymen!
- Matt
- <!-- m --><a class="postlink" href="http://members.cox.net/acrappa/javascript/project4.html">http://members.cox.net/acrappa/javascript/project4.html</a><!-- m -->
For this week's project, my instructor has challenged the class to accomplish the same task but with using a function. The function is used to convert the letter grade to a number (A=4, B=3, etc.). I haven't finished this yet, but here's my work in progress:
- <!-- m --><a class="postlink" href="http://members.cox.net/acrappa/javascript/project5prog.html">http://members.cox.net/acrappa/javascri ... 5prog.html</a><!-- m -->
Something is causing an error in my function. I know that I've properly called it, but something is not right. For every class that is entered, the default in the 'switch' reports the 'default' error. That is, instead of converting three grades to three numbers, the default message displays three times telling the user to use proper formatting.
I'm not sure if my problem is the way I'm using a 'switch' in the function or if something is setup wrong.
I don't want and am not encouraging a flat-out answer for this. I'm hoping that someone here who is experienced with JavaScript can point me out to what I'm doing wrong in which portion of code. Hopefully I can figure it out myself, but right now I'm a bit stuck.
Help me, journeymen!
- Matt