subject

LAB: Praising 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 ACTIVITYLAB 11.6.1: Parsing dates
DateParser. java
1 import java. util. Scanner;
2
3 public class DateParser {
4 public static int get MonthAs Int(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 monthInt = 2;
14 break;
15 case "March":
17 monthInt = 3; break:
18 case "April":
19 monthInt = 4;
20 break;
21 case "May":
22 monthInt = 5;
23 break;
24 case "June":
25 monthInt = 6;
26 break;
27 case "July":
28 monthInt = 7;
29 break;
30 case "August":
31 monthInt - 8:
32 break
33 case "September":
34 monthInt = 9;
35 break;
36 case "October":
37 monthInt = 10;
38 break;
39 case "November":
40 monthInt = 11;
41 break;
42 case "December":
43 monthInt = 12;
44 break;
45 default:
46 monthInt = 0;
47 }
48
49 return monthInt;
50 }
51
52 public static void main(String[] args) {
53 Scanner scnr = new Scanner(System. in);
54
55 // TODO: Read dates from input, parse the dates to find the one
56 // in the correct format, and output in m/d/ format
57
58 }
59 }
60

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
Which of the following commands is more recommended while creating a bot?
Answers: 1
question
Computers and Technology, 22.06.2019 21:30
This graph compares the total cost of attending educational institutions in texas. the graph demonstrates that the cost at private and public technical schools greatly varies.
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Drag the tiles to the correct boxes to complete the pairs. match the errors with their definitions. #name #value #ref when a formula produces output that is too lengthy to fit in the spreadsheet cell arrowright when you enter an invalid cell reference in a formula arrowright when you type text in cells that accept numeric data arrowright when you type in a cell reference that doesn’t exist arrowright reset next
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
*! 20 points! *jeff wants to create a website with interactive and dynamic content. which programming language will he use? a. dhtml b. html c. css d. javascript
Answers: 1
You know the right answer?
LAB: Praising dates Complete main() to read dates from input, one date per line. Each date's format...
Questions
question
Social Studies, 08.04.2020 23:19
question
Physics, 08.04.2020 23:19
Questions on the website: 13722362