Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

WEB230 JavaScript 1 Assignment 2a - Quiz Average In this assignment we will write a JavaScript program to calculate the average of a set of

WEB230 JavaScript 1

Assignment 2a - Quiz Average

In this assignment we will write a JavaScript program to calculate the average of a set of quiz marks. Instructions 1. Create variable containing an array that will contain five or more numbers that represent the marks on quizzes. It is assumed that all quizzes will be out of 10 so the numbers must be values between 0-10.

2. Create a function that will take the array as an argument and return the average of the quizzes.

3. Output a text message with the values of the quizzes (without the brackets) and the final average. Sample Output

Quiz marks: 6 7 8 8 9 7 6 8 The average is 7.3 / 10.

Notes JavaScript has a method called .toFixed that will take a number and convert it to a string with a fixed number of decimal places. Don't do .toFixed in the function (you want to return a number), do it when you display the value. let num = 4.5678; console.log(num.toFixed(2)); // 4.57 Submission Do not use the var keyword. Instead use let or const. Do not include any HTML tags Do not use document.write() Save your code to a file called as2a.js

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions