Question: class Integers { / / Constructor takes * * any * * number of arguments, which are integers / / Instances have an ` ints
class Integers
Constructor takes any number of arguments, which are integers
Instances have an ints property which is an array holding the integers above in the same order
Implement a getAll method which returns the data held in the ints property
Implement a getEvens method which returns an array with the integers that are even
Implement a getNegatives method which returns an array with the integers that negative
Implement a getAllSquared method which returns an array with the integers squared
Implement a pop method which removes the last integer from ints and returns it
Implement a push method which takes an int and pushes it to the end of ints and returns the updated ints property
Implement a getEveryNth method which takes an int n and returns an array with the ints at position n n n n n n etc
Implement a getAllReversed method which returns the ints in reverse order
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
