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

The instructions are pretty clear and detailed, so what exactly is stopping you from making progress?

Ps: what is the ConsoleInput class? Itโ€™s not part of the Java SE API.

So, the ConsoleInput file is here. What is stopping is that I am having a difficult time thinking on how to make this program run properly. Here is what I have written so far.

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.