CRUD

  • 18
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 (18)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Liliane Top Level 20, Amsterdam, Netherlands
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 20, 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 22, Denver, United States
12 September 2020, 17:35
There is clearly something that I am totally missing here....
Anthony Mack Level 23, 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.
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.
Kaffi Level 19, Poland, Poland
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.
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 23
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
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 23
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.
ulmas9025 Level 20, Tashkent, Uzbekistan
6 August 2019, 03:18
help my
Ewerton Level 30, Belo Horizonte, Brasil
3 July 2019, 14:47
My mistake was: Example input:
-c Washington m "04 15 1990"
What I thought was format:
new SimpleDateFormat("\"MM dd yyyy\"")
What it really was:
new SimpleDateFormat("MM dd yyyy")
Raivo Lapiņš Level 18, Riga, Latvia
4 June 2019, 15:45
I think this task is poorly worded. You should probably mention that the main() method or programs entry point takes a list of arguments. I was trying for so long to figure out why my input from the console line doesn't pass the tests although they met requirements. So for those who are struggling as I did - you must work with
main(String[] args)
as input for the program. Don't create your own readers and don't read user input.
Ed Maphis Level 20, Painesville, United States
15 June 2019, 17:37
Thanks
Juanf Level 25, Vilnius, Lithuania
6 October 2019, 20:55
Thank you so much!
Diana Salvador Level 26, Sintra, Portugal
5 February 2020, 17:37
Yes, I figured it out now too, after 3h30 hours... It isn't obvious at all.