Question: CGS 2 8 2 0 : JavaScript I need help with this Assignemnt: When the user clicks on the Calculate Grade button, form data entry
CGS : JavaScript
I need help with this Assignemnt:
When the user clicks on the "Calculate Grade" button, form data entry should be checked to make sure that all fields are filled with the correct data values. Note that IDs are not allowed to be less than Also, exam scores cannot be less than or bigger than If any of these requirements are not met, then an appropriate alert window should be opened and processing should be stopped. Once the data is valid, the exam average should be calculated and the letter grade for that average should be determined by calling a function named determineLetterGrade and passing it the average. The function should be expected to return the letter grade associated with that average. You must write this function. See below for algorithm. The original data from the form as well as the exam average should be put in
tags that are placed in a
tag and the
tag should be appended to the section tag that has an ID of "report". All exam scores, including the average, should be displayed with
decimals. The total exam average should be calculated as well as a counter that tracks the number of students entered. When the user clicks on the "Clear Form" button, any data in the input areas should be cleared. When the user clicks on the "Compute Class Average" button, the program should determine the average class score by dividing the total of the averages by the count of students but only if the count is bigger than zero. The results should be displayed in a
tag below the last
that had student info. The number of students as well as the average of the averages should be displayed. The average should be displayed with decimal place. The count should not be displayed with any decimal places. When the user clicks on the "Clear Report Area" button, the program should clear out what it displayed inside the section tag with the ID of "report".
The algorithm for the determineLetterGrade function: Note that this function takes one parameter which is an average grade. Assign the empty string to a local variable named letterGrade. If the value in the parameter is bigger than or equal to assign A to the letterGrade variable. Else if the value in the parameter is bigger than or equal to assign B to the letterGrade variable. Else if the value in the parameter is bigger than or equal to assign C to the letterGrade variable. Else if the value in the parameter is bigger than or equal to assign D to the letterGrade variable. Else assign F to the letterGrade variable. Return the letterGrade variable
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
