isPowerOfTwo

Category: Programming
Author: Alan Borning and Dan Grossman
Book Chapter: 4.2
Problem: isPowerOfTwo
Write a static method isPowerOfTwo that takes an integer n as an argument, and that returns true if n is a power of
two, and otherwise false. If n is zero or negative, return false. Note that isPowerOfTwo(1) should return true,
since 20=1.