Question: please do as to be done in notepad++ as html file Write a JavaScript function that takes the numerical grade of a student as its

please do as to be done in notepad++ as html file

Write a JavaScript function that takes the numerical grade of a student as its argument and returns the equivalent letter grade according to the following table:

Final grade

Letter Grade

90 - 100

A+

85 - 89

A

80 - 84

A-

77 - 79

B+

73 - 76

B

70 72

B-

67 69

C+

63 66

C

60 62

C-

50 - 59

D

F

Save your function in a file named lg.js. Then make an html file to test this function using several arbitrary inputs.

Task 2:

Make a website for saving students final grades. The website should have a form for entering the following information:

  • Student ID
  • Course number
  • Final grade (percentage)

The webpage also has a button titled Submit. Once the user is done with entering the above information, he/she presses the submit button. Then your website, using JavaScript, has to do some preliminary validations as follows:

  • checks if any field is empty, if yes it has to show an error message
  • checks if the student ID has the right format. The student ID is supposed to be a 9 digit number starting with 300.
  • checks if the course ID is correct. For now, we have only three courses with Ids CIS145, CIS245 and CIS152. Any ID except these should cause the website to show an error message.
  • checks if the final grade is a number between 0 and 100 (inclusive), otherwise an error message should be displayed.

If the user input passes all above checks then your website should show the corresponding letter grade in some specific area of your page (which is up to you). Use lg.js (developed in Task 1) for converting numerical grade to letter grade.

Task 3:

Choose an image/icon for each of the following grade categories:

  • Category A: grades A+,A,A_ (like, a very joyful picture)
  • Category B: grades B+,B,B_ (like, a half joyful picture)
  • Category C: grades C+,C,C_,P (like, a so-so picture)
  • Category F: grade F (like, a sad picture)

Modify Task 2, so that in addition to showing the letter grade in some specific text area, it also shows the corresponding image according to the above categories in some area of your website. To do so, use arrays

Answer to refer :

Grade

function gradeForm() { var a= document.getElementById("id1"); var a= parseInt (id1.value); var grade = document.getelementbyId("grade"); console.log(Hurrah!!); var Grade; if ((a=90)) {Grade="A+" alert("Name must be filled out"); } var Grade; if ((a=90)) {Grade="A+" alert("Name must be filled out"); } var Grade; if ((a=85)) {Grade="A" alert("Name must be filled out"); } var Grade; if ((a=80)) {Grade="A-" alert("Name must be filled out"); } var Grade; if ((a=77)) {Grade="B+" alert("Name must be filled out"); } var Grade; if ((a=73)) {Grade="B" alert("Name must be filled out"); } var Grade; if ((a=70)) {Grade="B-" alert("Name must be filled out"); } var Grade; if ((a=67)) {Grade="C+" alert("Name must be filled out"); } var Grade; if ((a=63)) {Grade="C" alert("Name must be filled out"); } var Grade; if ((a=60)) {Grade="C-" alert("Name must be filled out"); } var Grade; if ((a=50)) {Grade="D" alert("Name must be filled out"); } var Grade; if ((a

function changeImage() { var img = document.getElementById("grade"); if (grade == A+) else turn = 1; img.src = "im"+turn+".jpg"; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!