Question
I don't understand this one:/ Develop the Student Scores application In this exercise, youll develop an application that tracks students scores, tallies the average of
I don't understand this one:/
Develop the Student Scores application In this exercise, youll develop an application that tracks students scores, tallies the average of the entered scores, and sorts the entered students by last name. In the JavaScript file, note that six functions are supplied. The $ function. The start of a displayScores function. The start of an addScore function that ends by clearing the add form and setting the focus on its first field. The start of a clearScores function that ends by clearing the display area and setting the focus on the first name field. The start of a sortScores function. And an onload event handler that attaches the addScore, clearScores, and sortScores functions to the click events of the appropriate buttons and sets the focus on the first name field. To start, code two global arrays, one to hold the score values and the other to hold the strings that display the students names and scores. In the displayScores function, add the code that calculates the average score of all the scores in the first array, and stores it in the text box below the text area. Then, add the code that gets the students names and scores in the second array and displays it in the text area. In the addScore function, use the push method to save the score in the first array and to save the name and score string (as shown in the text box) in the second array. Then, call the displayScores function to redisplay the updated data. In the clearScores function, add code that clears both global arrays. In the sortScores function, add code that sorts the students by last name and then re-displays the score information.
scores.js file var $ = function (id) { return document.getElementById(id); }; var displayScores = function () { }; var addScore = function () { // get the add form ready for next entry $("first_name").value = ""; $("last_name").value = ""; $("score").value = ""; $("first_name").focus(); }; var clearScores = function () { // remove the score data from the web page $("average_score").value = ""; $("scores").value = ""; $("first_name").focus(); }; var sortScores = function () { }; window.onload = function () { $("add_button").onclick = addScore; $("clear_button").onclick = clearScores; $("sort_button").onclick = sortScores; $("first_name").focus(); };
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started