Professional Documents
Culture Documents
MagicSum.java
Write a Boolean method called hasEight(), which takes an int as input and returns true
if the number contains the digit 8 (e.g., 18, 168, 1288).
Now write a main program called MagicSum, which prompts users for integers (or -1
to end) and produces the sum of numbers containing the digit 8. Your program
should use the above method. Here is a sample output.
SmallestNum.java
Write a Java method to find the smallest number among three numbers. Here is
some sample output.
Challenge: You could add a counter that keeps track of how many of each vowel
there is. You could also allow your program to look at phrases, not just words.
Password rules:
HINT: The ascii table will be a huge help here or even better regex!!!
Exponent.java
Sample Output: