- 1

Java array

Write a program to store the names of the months in an array and the number of days of each month in another array Then Printing the names of the months that have 30 days? Calculate the number of months that have 31 days? The solution is using the Java language

1st Jul 2021, 1:53 PM
ŰšŰ§ŰźÙ„Ű§Ù‚ Ű§Ù„Ű§ŰłÙ„Ű§Ù… Ù†Ű±ŰȘقي Űč.ي
ŰšŰ§ŰźÙ„Ű§Ù‚ Ű§Ù„Ű§ŰłÙ„Ű§Ù… Ù†Ű±ŰȘقي Űč.ي - avatar
3 Answers
+ 1
Pls share your attempt ?
1st Jul 2021, 2:45 PM
Nanda Balakrishnan
0
Please complete at least 50% of the Java course here in order to be able to solve the task. SoloLearn is a site to learn, code, seek genuine help and interact, so please don't expect free solutions to homeworks, assignments, etc. I hope that this helps.
1st Jul 2021, 2:05 PM
Calvin Thomas
Calvin Thomas - avatar
0
Manualy create an arrays. The first one (with names) will be String array and the second one int array. Initialize int variable for sum with starting value 0. Then use for loop to iterate through the int array. Inside the loop put two if statements. First check if number of days is equal 30 then print name stored in string array with the same index of actual item in iteration. And second if statement for checking if number of days is equal 31 and then add to sum plus one. When loop ends just print sum value.
3rd Jul 2021, 11:18 AM
Jimmy Phoitick
Jimmy Phoitick - avatar