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 00:30
Which of the following methods could be considered a “best practice” in terms of informing respondents how their answers to an on-line survey about personal information will be protected? respondents are informed that investigators will try to keep their participation confidential; however, confidentiality cannot be assured. respondents are informed that a research assistant will transfer all the research data to a password-protected computer that is not connected to the internet, via a usb flashdrive. the computer is located in a research team member’s office. the investigator uses the informed consent process to explain her institution’s method for guaranteeing absolute confidentiality of research data. the investigator uses the informed consent process to explain how respondent data will be transmitted from the website to his encrypted database without ever recording respondents’ ip addresses, but explains that on the internet confidentiality cannot be absolutely guaranteed.
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
The isometric projection camera technique provides an illusion of perspective by using things like parallax scrolling to create the illusion of 3d in a 2d game
Answers: 3
question
Computers and Technology, 22.06.2019 23:30
The next button in the review section shows the next available comment. next slide with no comment. previous comment. edited comment.
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Quic which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
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
Questions on the website: 13722362