Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CHALLENGE 1 - Integers class Integers { // Constructor takes **any** number of arguments, which are integers // Instances have an `ints` property which is

CHALLENGE 1 - Integers 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 0, n, n + n, n + n + n, etc // Implement a `getAllReversed` method which returns the ints in reverse order // WARNING: except for `getAllReversed`, methods must respect the order of the integers // WARNING: note that none of the methods actually mutate the `ints` property }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

10. What is meant by a feed rate?

Answered: 1 week ago

Question

Describe the nature of negative messages.

Answered: 1 week ago