printPowersOf2 that uses a cumulative algorithm to print out the powers of 2 up to 2x.
It should take a parameter that determines x; that is, the exponent of the highest power of 2 to be printed.
For example, the following call:
printPowersOf2(10);
should produce the following output, because 210 = 1024:
1 2 4 8 16 32 64 128 256 512 1024
(For this problem it's okay if your numbers have a .0 at the end of them.)
main method.
Call your method several times in main to ensure that it works.
Also check your answer using Practice-It by clicking the check-mark icon above.