Question: I need this in Java: /** * Class for storing the last ten integers added. * * Your class should be named LastTen. * *

I need this in Java:

/** * Class for storing the last ten integers added. * * Your class should be named LastTen. * * Your class should implement two public methods as described below: * 1. void add(int newValue): * add a new integer to the values that we are rememebring * 2. int[] getLastTen(): * return the last ten values that were added using add, in any order. * If fewer than ten values were added, you should return zeros in their * place. * * Examples: * 1. add(1), add(2) * getLastTen: [1, 2, 0, 0, 0, ... ] * 2. add(0), add(1), add(2), ... add(10) * getLastTen: [1, 2, 3, 4, ... 10] * * Your class should also provide a constructor that takes no arguments. */

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!