CRUD 2
bd (birth date in the following format: 04 15 1990)
CRUD
bd (birth date in the following format: "04 15 1990")
The way the format is mentioned is different for both assignments, one is with quotes and the other without quotes and no wonder my solution would never work.👎Please change this.
hidden #10656888
Level 22
The format for date is different for both crud assignments but solution expects to have the same format, its confusing.
Under discussion
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
Guadalupe Gagnon
6 January 2021, 14:39useful
It looks the same for me:
-c name sex bd
-u id name sex bd
-d id
-i id
-c name1 sex1 bd1 name2 sex2 bd2 ...
-u id1 name1 sex1 bd1 id2 name2 sex2 bd2 ...
-d id1 id2 id3 id4 ...
-i id1 id2 id3 id4 ...
This is telling you the specific format for each index. There would not be any quotation marks in any of these. The args array is a String[] so anything in it would be a String, but they added the quotation marks in the first task to emphasize that point.
+1
Guadalupe Gagnon
6 January 2021, 14:56useful
If you haven't learned this yet: you can enter the program arguments in the "Edit Configurations" window (see Pic):
You enter each argument separated by a space and they will appear in the args array. You can test it simply with:
Because each element is separated by space, names can be very hard to predict if they are spread out, such as if you wanted to enter 3 names like this:
Guadalupe Gagnon Ralph Jean Luc Van Damme
The resulting array would be:
{"Guadalupe", "Gagnon", "Ralph", "Jean", "Luc", "Van", "Damme"}
As a programmer, you can't write code to separate that for every infinite possible combination of names that could be put in args. That is why, went entering the program arguments, anything in quotation marks will be in 1 index. So if you change the program arguments to:
"Guadalupe Gagnon" Ralph "Jean Luc Van Damme"
The resulting values in args would be:
{"Guadalupe Gagnon", "Ralph", "Jean Luc Van Damme"}
Now you can write code that does whatever with those names.

+1
hidden #10656888
29 January 2021, 00:14
You're right and thank you for taking the time to respond 👍, the confusion happened because with and without quotes the args.length changes and that would have a significant impact on the solution, once again thank you for letting me know.
0