Declare a variable named total, setting its initial value to 0.

3. Below the script element you just created, insert another script element that contains the function amountTotal(). The purpose of the amountTotal() function is to return the sum of all of the values in the amount array. There are no parameters for this function. Add the following commands to the function:

a. Declare a variable named total, setting its initial value to 0.

b. Create a For loop that loops through all of the values in the amount array. At each iteration of the loop, add the current value of the array item to the value of the total variable.

c. After the For loop is completed, return the value of the total variable.


 

PLACE THIS ORDER OR A SIMILAR ORDER WITH BEST NURSING TUTORS TODAY AND GET AN AMAZING DISCOUNT

get-your-custom-paper

The post Declare a variable named total, setting its initial value to 0. appeared first on BEST NURSING TUTORS .

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.