"Hey, Amigo!"

"Hello, Captain Squirrels!"

"Congrats on completing the level. Before you move beyond, be sure to complete these coding tasks."

3
Java Syntax, level 9, lesson 11
Locked
Dividing by zero
Maybe you've been wanting this for a long time, but you were afraid? Drum roll, please! Today we will divide by zero! You actually can do it, if you're careful. Create a public static void divideByZero method that divides any number by zero, and display the result of division. Wrap the method call in a try-catch block and display the exception's stack trace.
3
Java Syntax, level 9, lesson 11
Locked
Countdown
Students at the secret CodeGym center were given a task to assess their skills: write a countdown from 10 to 0 to determine how much time is left before the end of this test. Cool, huh? To create a delay, you need to use Thread.sleep(100), and wrap the sleep call in a try-catch block. Time's up!
6
Java Syntax, level 9, lesson 11
Locked
Method in a try-catch
Each of you at least once in your life has probably entered a password or other text incorrectly. Let's protect a program from accidentally entering "incorrect" data. In this task, the user enters numbers from the keyboard. If he or she enters something else, then an exception-catching method should be triggered and display all previously entered numbers.
12
Java Syntax, level 9, lesson 11
Locked
What's today's date?
Java has many tools that allow you to work with dates and times. Here we will use a Date object and SimpleDateFormat. Our task is this: the user should enter a date from the keyboard in the format "2013-08-18", and the application must convert the entered date into the format "AUG 18, 2013".
12
Java Syntax, level 9, lesson 11
Locked
Vowels and consonants
You and I both know very well which letters are vowels and which are consonants. We need to teach these concepts to intelligent robots, so we'll write a program to train them. The user will enter a string from the keyboard. Then a special method will help to split the entered data into two strings: one with all the vowels and another with only the consonants.
6
Java Syntax, level 9, lesson 11
Locked
A scary fairy tale
Once there were five classes: red riding hood, grandmother, pie, woodcutter, and wolf. Each class has 2 fields: ArrayList killed and ArrayList ate. Create the necessary objects (hood, grandmother, ...). Then arrange the relationships correctly according to who ate and/or killed who to bring to life what happened in the old Terran fairy tale "Little Red Riding Hood".
3
Java Syntax, level 9, lesson 11
Locked
Static modifiers are out of place
Faint steps could be heard, and then Master Yu Wu, an expert in the art of positioning objects, appeared in the room. He frowned at the code and said what the programmer was afraid to hear: "Where they are needed, the static modifiers are not. Your error herein lies". The master was correct: Rearrange the static modifiers so that the program compiles.
6
Java Syntax, level 9, lesson 11
Locked
List of number arrays
By Level 9, students are already adept at manipulating arrays and they know a thing or two about lists. Let's unify this knowledge by trying the following task. We'll create a list whose elements are arrays of numbers. Then we'll add to the list five array objects whose lengths are 5, 2, 4, 7, and 0, respectively. Finally, we'll fill the arrays with any data and display them on the screen.
6
Java Syntax, level 9, lesson 11
Locked
Ten cats
I'd like ten cats and Java expertise, please. Preferably at the same time! Not a problem, hang on: the program has a Cat class with a String variable name. You need to create a Map and add 10 cats represented by (name, Cat) pairs. Then get a Set of all cats from the Map and display it on the screen.
6
Java Syntax, level 9, lesson 11
Locked
The code won't compile…
A developer pensively scratching her head while reviewing code is a sign that it won't compile! You must resign yourself to such situations and not be nervous. Here's some practice: The program reads in two file names. It copies the first file to the location specified by the second file name. And yes, the program doesn't work. Fix the mistake.
6