"Hello, Captain Squirrels!"
"Congrats on completing the level. Before you move beyond, be sure to complete these coding tasks."
Dividing by zero
Create a public static void divideByZero method that divides any number by zero, and display the result of the division. Wrap the divideByZero method call in a try-catch block. Display the exception stack trace using the exception.printStackTrace() method
Countdown from 5 to 0
The loop counts down from 5 to 0. Add a delay using Thread.sleep(100); Wrap the sleep call in a try-catch block.
There are four non-static methods: method1(), method2(), method3(), method4(). Using the throws keyword, make it so that method1() and method2() throw any checked exception, and method3() and method4() throw an unchecked exception.
Vowels and consonants
Write a program that reads a string from the keyboard. The program should display two lines: 1. The first line contains only the vowels from the entered string. 2. The second contains only the consonants and punctuation marks from the entered string. The letters should be separated by a space, each
A scary fairy tale
1. Once there were five classes: red riding hood, grandmother, pie, woodcutter, and wolf. 2. Each class has 2 fields: ArrayList killed and ArrayList ate. 3. The necessary objects have been created (hood, grandmother, ...). 4. Arrange the relationships correctly according to who ate and/or killed who
Static modifiers are out of place
Rearrange the static modifiers so that the program compiles.
List of number arrays
In the createList method: - create a list whose elements are arrays of numbers; - add to the list five array objects whose lengths are 5, 2, 4, 7, and 0, respectively; - fill the arrays with any data.
There is a Cat class with a String variable name. Create a Map and add 10 cats represented by (name, Cat) pairs. Get a Set of all cats from the Map. Display the set on the screen (already implemented).
Task about algorithms
The program reads words and numbers from the keyboard, adds them to a list, converts the list to an array, and then displays the array on the screen. Sort the array so that words appear in ascending order and numbers appear in descending order. Example input: Cherry 1 Bob 3 Apple 22 0 Watermelon E