CodeGym /Java Course /New Java Syntax /Practice creating and using arrays

Practice creating and using arrays

New Java Syntax
Level 6 , Lesson 4
Available

"Hi, Amigo! Here are a few tasks for you, my friend:"

6
Task
New Java Syntax, level 6, lesson 4
Locked
One large array and two small ones
1. Create an array of 20 numbers. 2. Populate it with values from the keyboard. 3. Create two arrays of 10 numbers each. 4. Copy the large array into the two small ones: half the numbers into the first small array, and the second half into the second small array. 5. Display the second small array, e
6
Task
New Java Syntax, level 6, lesson 4
Locked
Street and houses
1. Create an array of 15 integers. 2. Populate it with values from the keyboard. 3. Let the array index represent the house number. The array value at a particular index represents the number of people living in the corresponding house. Houses with odd numbers are located on one side of the street.
6
Task
New Java Syntax, level 6, lesson 4
Locked
2 arrays
1. Create an array of 10 strings. 2. Create an array of 10 numbers. 3. Enter 10 strings from the keyboard, and put them in an array of strings. 4. 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. Displ
Comments (60)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
BackwardsPi314 Level 6, San Francisco, United States
31 July 2024
Wauoh...
Radian Hoque Level 7, Footscray, Australia
3 February 2024
the street and houses was not tough to code but tough to breakdown the task requirements, make sure to read each requirements and if it helps you try to write the conditions step by step.
rags 3 Level 5, Wichita, United States Expert
7 July 2023
the street and houses one is touchy can have correct code still wont run
Jill L Level 10, China, China
25 February 2023
For task"2 arrays", What command can display the length of a string element in a string array?
rags 3 Level 5, Wichita, United States Expert
7 July 2023
what ever you name your string stringname.length String[] list = new String[]; list.length;
Godwin Level 14, Sango, Nigeria
18 October 2022
one thing I found very helpful is the debug tool in IntelliJ IDEA, it showed me the array index out of bound error clearly and I knew how to solve it, the result is passing verification once.
calibers16 Level 6, Knowhere, United States
8 September 2022
FYI, my solution to "2 arrays" works as expected and produced the identical output to the "correct solution," but for some reason it would fail the verification process. Jsyk.
rags 3 Level 5, Wichita, United States Expert
7 July 2023
the test are touchy some times you may have a space or something
Mindaugas Level 23, Lithuania
27 August 2022
Yeah, the hard task is not really that hard, but you have to read carefully third point, I failed 4 times verification only because misread what I needed to count 🧐
Krig Raseri Level 38, Dallas, United States
9 August 2022
The hard task is only harder because of the way it's written, and not actually coding it. Pay close attention to what it's asking for.
Boris Level 7, Novi Sad, Serbia
12 April 2022
One large array and two small ones: the following method of the java System class can be useful:

System.arraycopy(SourceArray, int srcPosition, TargetArray, int Position, int numberOfElements );
Siyanda Dlamini Level 7, Durban, South Africa
17 March 2022
The tasks are well thoughout