"Hai, Amigo! Berikut adalah beberapa tugasan untuk anda, kawan saya:"
5
Tugasan
Java Syntax, tahap, pelajaran
Maximum in an array
Whoever gets the best result in today's competition receives the key to New York City! He or she will need to automate 25 processes faster than 19 other classmates. Let's write a program that can help determine the winner of such competitions: create an array of 20 elements, fill it with numbers, and find the maximum.
5
Tugasan
Java Syntax, tahap, pelajaran
String array in reverse order
No, we're not going to reverse each string so that it becomes the mirror image of the original. We'll save that for another task! Here and now, we need to create an array of 10 strings, read 8 strings from the keyboard and save them in the array, and then display the contents of the entire array (10 elements) in reverse order.
5
Tugasan
Java Syntax, tahap, pelajaran
Lonely arrays interact
Let's create not one, but two arrays at the same time! One will be a refuge for 10 numbers, while the other will be a haven for 10 strings. Use the keyboard to populate an array of strings. In each element of the number array, record the length of the string whose string array index coincides with the current index of the number array. Then display the contents of the number array on the screen, and you're done.
2
Tugasan
Java Syntax, tahap, pelajaran
Flip the array
On Planet Linear Chaos, its inhabitants—ordered isomorphs—party with reckless abandon during the celebration of non-equilibrium! There's an extremely popular game called "flip the array". You too can play: create an array of 10 numbers, arrange them in reverse order, and then display them. Isomorphs really know how to party, don't they?
5
Tugasan
Java Syntax, tahap, pelajaran
One large array and two small ones
Once upon a time there was an array, and it was big. Well, relatively speaking. And he had two array friends who were half his size. Our task is to manipulate these guys. Numbers from the large array must be transferred to the two small ones (on a first-come, first-served basis), and then the second small array needs to be displayed. Can you do it?
5
Tugasan
Java Syntax, tahap, pelajaran
Streets and houses
A street brawl is going down. The even and odd sides of the street are trying to figure out who's tougher, and absolutely everybody, even little babies, are joining the fray. Let's determine which side has a higher chance of winning (more residents means better chances). We'll create an array of 15 numbers (15 houses, the array index is the house number). Then we'll write the number of residents in each cell and tally up the number of people on the even and odd sides of the street.