I have these two problems that were given to me, and I am having THE hardest time even figuring out where to start :[
The first one is..
Write a method, public static boolean Language(String word), to recognize workds from the following language:
{a^n|n is a prime number}
If the input work is from the language the method returns true and false, otherwise.
The second is..
Relative gravities of most planets in the solar system, the Sun, the Moon, are shown below. They let us find what a given weight on Earth would weigh on each body.
Sun: 27.94 Moon: .17 Saturn: 1.15 Mercury .37 Mars .38 Uranus 1.17 Venus .88 Jupiter 2.64 Neptune 1.18
Write a java program that lets a user find her weight on any of these. It should ask her to enter her weight and the name of the planet or body she wants. A loop and a nested switch structure in your program are required. The loop will be used to etst many cases (for different planets) and should be terminated be letter End.
Help!