Add a random fortune generator to your home page. That is, your page should contain a list of fortunes (stored as an array of strings), and should randomly select one of those fortunes to display each time the page is loaded. The fortune should be displayed just above the page footer, centered and enclosed in a box. For example,
|True wisdom comes not from knowledge, but from understanding.|
Create a Web page named grades.html that can be used to compute your grade for CSC 551. The page should prompt the user for homework, quiz, test, and final exam grades, and display those grades on the page. It should also compute and display the averages for each grade category, the overall average for the course, and highest guaranteed letter grade. Recall from the class syllabus that grades are weighted as follows:
|homework assignments||40 %|
|weekly quizzes||05 %|
|two 75-minute tests||30 %|
|(cumulative) final exam||25 %|
When computing the quiz average, be sure to take into account that the lowest quiz grade is dropped. Traditional cutoffs apply for guaranteed letter grades (A >= 90, B+ >= 87, B >= 80, C+ >= 77, C >= 70, D >= 60). For example, your page might display something like the following:
Note that to compute the weighted average, you simply multiply each component of the grade by its percentage of the overall grade and add. For example,
Since there will be many homework and quiz grades, having a separate prompt for each grade would be tedious and unwieldy. A better approach is to allow the user to enter related values at the same prompt. That is, they would enter all homework grades at the the first prompt, all quiz grades at the second prompt, both test scores at the third prompt, and finally the exam score at the fourth prompt. To make this possible, you are being given the following function:
The StringToArray function takes as input a string containing words, each separated by whitespace. It returns an array containing each of the individual words as elements. For example, the call StringToArray("80 95 92") would return the array ["80","95","92"]. Using this function, your program can read a sequence of grades into a single string using prompt, and then separate the individual grades into an array for averaging. Note that the array elements are strings, so you will need to parseFloat the array elements in order to average the grades.
There should be a link to your grades.html page somewhere in your home page.