Hi there,
In don't understand what is actually required in this task.
May I have some more detailed information about what it's to be done?
About task
Under discussion
Comments (4)
- Popular
- New
- Old
You must be signed in to leave a comment
LuisRC
9 January 2022, 15:00
Ok. thanks.
+1
LuisRC
9 January 2022, 11:50
Hi Lisa,
Here you have the conditions:
Implement a static main(String[]) method that populates the array variable with the values valueStart and valueEnd.
If the length of the array is even, then its first half must be filled with valueStart values, and the second half with valueEnd.
If the length of the array is odd, then fill the larger part with valueStart, and the smaller one with valueEnd.
To fill the array with values, use the Arrays.fill(int [], int, int, int) method.
During testing, the values of the fields in the Solution class will be different. Take that into consideration.
Requirements:
• Implement the main(String[]) method in accordance with the task conditions.
An here the code.
I did nothing because I don't understand what is this about.
An finallu here you have the link to the task.
https://codegym.cc/quests/lectures/en.questsyntaxpro.level05.lecture07.story
Tnaks
0
Lisa
9 January 2022, 12:24
As said, I can not open the task ;) but I think I may help you.
Given is an array line 11 and two values lines 12 and 13. Now fill the first half of the array with the first value, valueStart (10) and the second half of the array with the second value, valueEnd (13). The rest of the description is to make you some more work. If it would be the other way round (filling the smaller half with valueStart) you could just use array.length / 2 to determine the middle. The way CG want's to have it you need an if-else clause or a ternary operator like
Now just two more lines and the task is done ;)
0
Lisa
9 January 2022, 09:49
I can not open the task you're talking about. So without further info I can not be of help here. If you ask questions it is best to add your existing code to the question, that adds the tasks description, too.
0