subject

LAB: Parsing dates Complete main() to read dates from input, one date per line. Each date's format must be as follows: March 1, 1990. Any date not following that format is incorrect and should be ignored. Use the substring() method to parse the string and extract the date. The input ends with -1 on a line alone. Output each correct date as: 3/1/1990.
Ex: If the input is:
March 1, 1990
April 2 1995
7/15/20
December 13, 2003
-1
then the output is:
3/1/1990
12/13/2003
LAB ACTIVITY: LAB: Parsing dates
DateParser. java
1 import java. util. Scanner;
2
3 public class Dateparser {
4 public static int getmonthsInt(string monthstring) {
5 int monthInt;
6
7 // Java switch/case statement
8 switch (monthstring) {
9 case "January":
10 monthInt = 1;
11 break;
12 case "February": 13
13 monthInt = 2;
14 break;
15 case "March":
16 monthInt = 3;
17 break;
18 case "April":
19 monthInt = 4;
20 break;

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:30
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
Need ! will choose brainliest! discuss the role of abstraction in the history of computer software.
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
The option enables you to modify a slide element in most presentation applications.
Answers: 2
question
Computers and Technology, 23.06.2019 21:00
Alcohol’s affects on the cornea and lens of the eye make it more difficult
Answers: 1
You know the right answer?
LAB: Parsing dates Complete main() to read dates from input, one date per line. Each date's format...
Questions
question
Mathematics, 18.08.2019 20:00
question
English, 18.08.2019 20:00
question
English, 18.08.2019 20:00
question
Biology, 18.08.2019 20:00
Questions on the website: 13722365