Modify Listing 18.8, TowerOfHanoi.java, so the program finds the number of moves needed to move n disks

Question:

Modify Listing 18.8, TowerOfHanoi.java, so the program finds the number of moves needed to move n disks from tower A to tower B. (Hint: Use a static variable and increment it every time the method is called.)

Data from Listing 18.8,

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: