Write a program that prints the powers of ten

1.0
10.0
100.0
1000.0
10000.0
100000.0
1000000.0
1.0E7
1.0E8
1.0E9
1.0E10
1.0E11

Implement a class

public class PowerGenerator
{
   /**

   Constructs a power generator.
      \@param aFactor
the number that will be multiplied by itself
   */
   public PowerGenerator(double aFactor) { . . . }

   /**

   Computes the next power.
   */
   public double nextPower() { . . . }
   . . .
}

Then supply a test class PowerGeneratorRunner that calls System.out.println(myGenerator.nextPower()) twelve times.

Complete the following files:

PowerGenerator.java

public class PowerGenerator { . . . /** Constructs a power generator. @param aFactor the number that will be multiplied by itself */ public PowerGenerator(int aFactor) { . . . } /** Computes the next power. */ public double nextPower() { . . . } }

PowerGeneratorTester.java

Use the following file:

PowerGeneratorRunner.java

public class PowerGeneratorRunner
{
   public static void main(String[] args)
   {
      PowerGenerator myGenerator = new PowerGenerator(10);
      for (int i = 1; i <= 12; i++)
         System.out.println(myGenerator.nextPower());      
   }
}