“嗨,阿米戈。這裡有一些任務可以幫助你練習在屏幕上顯示東西:”
1
任務
Java Syntax, 等級 3, 課堂 4
Red scare
Dear CodeGym student, let's add a couple of lines to your dossier. No, no. Nothing like that. Just your date of birth. Why do we need this? We don't. It's for you. For educational purposes, of course. Just display your birth date in the format MAY 1 2012. And who are your parents? And do you have any subversive tendencies?
6
任務
Java Syntax, 等級 3, 課堂 4
Parenthetical brainteaser
It turns out that we have some code that doesn't do what we need it to. It also turns out that you have to fix this now. To get the correct result, you need to play around with parentheses: arrange them so that the desired number (382) appears on the screen.
6
任務
Java Syntax, 等級 3, 課堂 4
Hello, StarCraft!
You may never have heard of the ancient toy known as "StarCraft I", because it came out—it's scary to say—in 1998. In this strategy game, you had to select a race and play as either Terran, Protoss, or Zerg. Let's remember vacuum-tube-based StarCraft by creating representatives of all three races.
3
任務
Java Syntax, 等級 3, 課堂 4
Product of 10 numbers
Do you think you can easily multiply ten consecutive numbers from 1 to 10 in your mind? If this seems easy to you, you've probably never tried it. Here's a hint: the product is not a small number; it's more than three million. But this is easy for a computer: the important thing is to tell it how to do it.
1
任務
Java Syntax, 等級 3, 課堂 4
Sum of 5 numbers
If computers were anthropomorphic, they would most likely very often hear something like "hey, you're a computer", followed by a request to calculate something. Let's not fall behind the times. We'll ask the computer to calculate the sum of numbers from 1 to 5, line by line. And to help the computer to not get lost, let's write a proper program for this task.