amontellano 0 Newbie Poster

Hi everyone, I need ideas on how to initialize a new program in which a class GeometricSequence will extend 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

I need suggestions on how to implement and call methods. I included some of my work in a file.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.