0% found this document useful (0 votes)
2 views2 pages

Date Array Question

The document contains Java code for a method named 'solution' that processes an array of strings representing dates. It splits each date into components and checks for specific conditions to populate an output array. The code includes logic for handling date formats and outputs results based on comparisons.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Date Array Question

The document contains Java code for a method named 'solution' that processes an array of strings representing dates. It splits each date into components and checks for specific conditions to populate an output array. The code includes logic for handling date formats and outputs results based on comparisons.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

eclipse-workspaceFA/src/date/Tester.

java Eclipse IDE


-

Run Window Help


File Edit Source Refactor Navigate Search Project

Package Expl.. 3 0 Testerjava [Link] [Link] D1java [Link] Exercisejava [Link]


solution(instr
10
Assignments 11 public static void solution(String[] instrArr1) {
12 String[] outStrArr=new String[[Link]]
Dem0 int ind=0;
v FA 13
for(int i-0;i<inStrArr1.1engthit+) {
JRESystem Library[JavaSt String ele-instrArr1[il
src 16 String[] [Link](""-2);
date String dateMonth-temp[0]+tempf1]
DTesterjava String[] temp2-new String[4]:
temp2[0]=dateMonth;
eight jan temp2[1]-[Link](1)+[Link](0, 1)
eigth feb temp2[2]-[Link](2)+[Link](@, 2)
temp2[3]=[Link](3)+[Link](0, 3);
fourth jan
#numberplate int flag-0
for(int j-0;j<[Link]++) { I
seven if(temp2[j1-equals(temp[21)) {
unknown flagtt
moduie-infojava
FirstProject
teration1 if(flag0) {
outstrArr[ind]=temp[2]
New
else if(flag--0) {
outStrArr[ind]="X";

ProblemsJavadoc Declaration Console


[Link] (07-Apr-2021, 9:02:43 AM-9:02:45 AE
terminated> Tester (22) [Java Application] C:\Program
1103
X

2002
eclipse-workspace FA/src/date/[Link] Eclipse IDE ,

File Edit Source Refactor Navigate Search Project Run Window Help

G P
Package Expl. [Link] D [Link] Testerjava Ds1java [Link] Exercisejava [Link] 3
18 String[] temp2=new String[4]
9 temp2[0]=dateMonth
Assignments 20 temp2[1]=[Link](1)+[Link](®, 1);
Demo 21 temp2[2]=[Link](2)+[Link](0, 2);
temp2[3]=[Link](3)+dateMonth. substring(@, 3);
FA
JRE System Library JavaSt int flag-0
sre
for(int j-0:[Link]++) {
date
if(temp2[i].equals(temp[2]))
26 flagtt3
[Link] 27
eight jan
eigth feb if(flage)
outStrArr[ind]-temp[21
fourth jan
numberplate else if(flag-0)
seven outstrArr[ind]"X" I
unknown ind++3
[Link]
FirstProject for(int i-0;i<[Link]+)
teration1 [Link](outStrArr[i])
New 39
40
41

Problems Javadoc Declaration Consoie &


<teminated Tester(22)JavaApplication] CAProgramFilesVavajdk [Link] (07-Apr-2021, 9H02:43 AM- 902:45 AM)
1103
X
X
2002

Writable Smart Insert 39 10:1062

You might also like