Hi everyone, I need ideas on how to initialize a new program in which a class GeometricSequence will extends Sequence. It has to implement public void generate ( ), which generates the sequence via
𝑎𝑖 = 𝑎0∙generator𝑖 (𝑖 = 0, 1, …, numTerms−1) and puts it into a double []. In java, 𝑎𝑏 is
programmed via Math.pow ( a, b ). So once the sequence is generated, public void generate ( ) should call public void setTermArray ( double [] dA ).
For example, when SequenceTest is run using 𝑎0 = 3, generator = 4 and numTerms = 9, the output of
the program will look like what is shown below.
a0 = ? 3.0
generator = ? 4.0
number of terms = ? 9
------+------------
i | a_i
------+------------
0 | 3.0000
1 | 12.0000
2 | 48.0000
3 | 192.0000
4 | 768.0000
5 | 3072.0000
6 | 12288.0000
7 | 49152.0000
8 | 196608.0000
------+------------
sum = 262143.0000