Exercise: Exponential Growth

Write a console program that visualizes exponential growth. The program should:

Your program output should look exactly like this (user input in green):

Enter maximum exponent: 8
2^1 = 2
**
2^2 = 4
****
2^3 = 8
********
2^4 = 16
****************
2^5 = 32
********************************
2^6 = 64
****************************************************************
2^7 = 128
********************************************************************************************************************************
2^8 = 256
****************************************************************************************************************************************************************************************************************************************************************

You'll probably need to scroll to see all the stars.

If the user enters a number that's too high, just print an error message:

Enter maximum exponent: 32
Input is too high, enter a number smaller than 32.

Hand in instructions

  1. Make sure your program runs correctly.
  2. Follow Java naming conventions of variables.
  3. Make sure your program is well-formatted.
  4. Hand in your program by uploading Main.java to Moodle.