How do you write a write a value return function computes the average of four scores and returns the average? That score must then be sent to a function to determine the letter grade.
It's not as simple, but it is still very simple. Just multiply each score by its weight, and add everything up. For example with your numbers, you could use the expression 0.10*a + 0.20*b + 0.30*c + 0.40*d