CRUD

  • 18
  • Locked
CrUD: Create, Update, Delete. The program runs with one of the following sets of arguments: -c name sex bd -u id name sex bd -d id -i id Argument values: name (String) sex ("m" or "f") bd (birth date in the following format: "04 15 1990") -c (adds a person with the specified arguments to the end of
You can't complete this task, because you're not signed in.
Comments (27)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
matemate123
Level 28 , Kraków, Poland
17 January, 09:36
It seemed fishy, why in the task description nothing about reading from console. Thanks for help guys. When we used args, task is nicer. Can be a little harsh when we have battle with terminal, but after that we're stronger and more resilient.
Tasmoda Android Developer
16 July 2022, 13:21
WARNING! Task has the potential to make your eyes drip some crystal clear liquids.
Thành Black
Level 49 , Hanoi
28 September 2021, 06:56
I don"t know anything
Mike S
Level 24 , Saint Louis, United States
26 January, 19:54
It appears that you've come a long way, Thanh. But I commiserate with the 'you' of the past. I feel so dumb right now.
Liliane Top Backend Developer at Procura
28 December 2020, 09:25
If you're lost with this task watch this video: https://www.youtube.com/watch?v=QBLcP0kRqMw I recommend at speed 1.25 and you can solve this one easily!!
MoJo
Level 22 , Cairns, Australia
29 November 2020, 22:13
this one wasn't easy... I knew there was something up when i didn't find the word "console" in the description. Look up the other comments for more info on what to do.
AlfredW
Level 23 , Denver, United States
12 September 2020, 17:35
There is clearly something that I am totally missing here....
Anthony Mack
Level 24 , Waukesha, United States
1 September 2020, 03:02
I would appreciate any feedback on why my code isn't working. I thought I'd be clever and try to use switch statements instead of if-else statements, but it doesn't appear to be accepting anything at all. Thank you in advance for your help.
BlueJavaBanana
Level 37
18 May 2020, 15:25
PRO TIP!!! This task uses the String[] args bit of the main(String[] args) If you want to test this and run code based on th String[] args in IntelliJ do this: 1. Click on the play button next to public static void main.... 2. Select the last option 'Create solution main'... 3. In the Create Run Configuration window look to Program Arguments 4. Set your arguements here for example: -u 1 Washington m "04 15 1990" or -c Washington m "04 15 1990" This took me a LONG time to figure out, hope it helps someone else.
22 June 2020, 13:05
Great advice. Thanks!!!
Petros
Level 23 , Columbia, United States
17 August 2020, 21:08
For those like me that like baby steps, I want to add to this: -u would be args[0], 1 would be args[1], m would be args[2] and "04 15 1990" would be args[3]. So -u 1 Washington m "04 15 1990" is all entered in the command line or in the Program Arguments mentioned above. The program then updates at Index 1 by changing the name, sex and birthdate to the aforementioned values. -c Washington m "04 15 1990" will go up to args[2] (args[0] = -c) (args[2] = "04 15 1990"). I know this is obvious to some but trying to also understand the command line threw me off. That's how the main method should be set up. Took wayyy too long to figure this out. I hope there's a lesson on this in the near future.
Mike S
Level 24 , Saint Louis, United States
30 January, 23:16
After 16 tries and probably about 6 hours with this, I finally solved this. Special thanks to Petros for breaking down the problem and requirements in a way that I was able to finally start understanding! : )
Nyerges Ferenc
Level 23 , Bükkábrány, Hungary
21 March 2020, 17:54
Awesome task, passed for the first time :-) Bit surprised I'm the 304th, though - where are the others?
Attila
Level 25
15 April 2020, 03:00
Gratulalok ha ez elsore sikerult.
Sela
Level 20 , Poland
9 August 2020, 07:56
much more now - updated count is 456
Dawid Bujnicki Junior Developer
3 June 2021, 11:58
645 people have done this task by now
Ahmed
Level 23 , Amsterdam, Netherlands
13 August 2019, 03:02
Is the best way to get the last index by using the size method? Like:
System.out.println(allPeople.size() - 1);
Anyone has another idea? I tried the method (lastIndexOf) but it doesn't seems to work
Attila
Level 25
15 April 2020, 02:58
Haha, my first thought was the same, but it seemed very unprofessional.. So actually it is:
allPeople.indexOf(Object);
Note: This is Java arraylist IndexOf() method, not the same asJava String indexOf() Method.