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, 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 05:00
Acompany is inviting design for its new corporate logo from its users. this is an example of ? a. crowdfunding b. crowdvoting c. crowdsourced design d. crowdtracking
Answers: 3
question
Computers and Technology, 23.06.2019 09:30
:you areto design the controller for alight that functions both as an ordinary light and also as a motion activated light and alarm. a.if the manual switch s is on, then the light l is on. b.besides the manual switch, there is a motion detector, m1, which activatesthis light.c.if motion is detected but the light is on anyway because s is on, only then a secondoutput a, an alarm, is turned on. d.the disable switch, d, disables the motion activated light and alarmbut leaves manual control operation of the light using switch s.(i)read the problem statement and clearly identify the inputs and outputs for the circuit you are designing. (ii)create the truth table for this system; include the light, alarm, switch, disable, and the motion sensor.(iii)draw a schematic of this system.
Answers: 1
question
Computers and Technology, 25.06.2019 04:10
This might be a bit off-topic, but i'm having trouble with a certain arg made by game theory. if there are any theorists out there that wanna , it would be appreciated!
Answers: 2
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
Mathematics, 29.03.2020 22:59
question
Mathematics, 29.03.2020 22:59
question
Advanced Placement (AP), 29.03.2020 22:59
question
Mathematics, 29.03.2020 22:59
Questions on the website: 13722360