Make sure your program includes a function that has
a parameter, an if-statement, and a loop.
Make sure your program includes a function that has
a parameter, an if-statement, and a loop.
Example Algorithm 4 function addPositives(list){ var total = 0; var currentItem; for(var i = 0; i < list.length; i++){ currentItem = list[i]; if(currentItem > 0){ total = total + list[i]; } } return total; } |
WENXUECITY.COM does not represent or guarantee the truthfulness, accuracy, or reliability of any of communications posted by other users.
Copyright ©1998-2025 wenxuecity.com All rights reserved. Privacy Statement & Terms of Use & User Privacy Protection Policy