Graduate Assignment 1

by Larry Adams

HTML

<h2>Graduate Assignment 1</h2>
<p>Your task is to change the letters to numberic values and add a promot for entering in numbers to represent grades.  If you enter a 92 it should equal an "A-" which is a good job.  Please use Harvard grading scale to represent the output</p>
<h2 id="demo"></n2>

JavaScript

/* The purpose of this assignment is to better understand conditional statements written in a switch/case method. When is it approaite to switch (no pun intended) out of a if/esle condition.  The general rule is when you have more than 3 condition test you can or maybe should move to a switch.
*/


var grade = prompt ("Please enter yourletter grade", "A");
switch (grade)
{
  case 'A': console.log("Excellent work!<br />");
            break;
  case 'B': console.log("Good good<br />");
            break;
  case 'C': console.log("Passed<br />");
            break;
  case 'D': console.log("Not so good<br />");
            break;
  case 'F': console.log("You have Failed<br />");
            break;
  default:  console.loge("Unknown grade<br />")
}

document.getElementById("demo").innerHTML =
        "Your Grade is a  " + grade + "! ";