sum67

Objective: Write program code to create, traverse, and manipulate elements in 1D array or ArrayList objects.

Complete the method sum67, which returns the sum of the numbers in the list, except ignore sections of numbers starting with a 6 and extending to the next 7 (every 6 will be followed by at least one 7). Return 0 for no numbers.

sum67([1, 2, 2]) -> 5
sum67([1, 2, 2, 6, 99, 99, 7]) -> 5
sum67([1, 1, 6, 7, 2]) -> 4

The following are methods of a list that can be used to manipulate the contained data.

Type your solution        
Skills Practiced:
3.C
3.D
4.A
4.B
Copyright © StudyCS 2024 All rights reserved.