id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > poolAltTotal
prev  |  next  |  chance

Write a method that alternately adds and subtracts elements of an integer array to get a total. Return that total.


poolAltTotal([3, 1, 7, 4, 9]) → 14
poolAltTotal([5, 1]) → 4
poolAltTotal([7]) → 7

...Save, Compile, Run (ctrl-enter)

public int poolAltTotal(int[] nums) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 290

Copyright Nick Parlante 2017 - privacy