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, 22.06.2019 16:30
Corey set up his presentation for delivery to his team.the information he had to convey was critical to their job performance.he knew he would need a lot of time to explain each point
Answers: 3
question
Computers and Technology, 24.06.2019 13:00
Your mom wants to purchase a laptop computer. she said she wants her new computer to be able to play her dvds so she can listen to music and wants to know what type of optical drives will play her disk. which type of drive should she look for?
Answers: 1
question
Computers and Technology, 24.06.2019 14:00
Fast answer i need for apex ! smartphones should be banned from the classroom in public schools so that students cannot cheat on test so easily? which is an example of a counter argument to the thesis above? a.the classroom is a place for learning not for making phone calls b. smartphones are useful learning tools in the modern classroom c.banning smartphones will not students pay attention to teachers any better d. banning smartphones would decreased incidents of theft
Answers: 2
question
Computers and Technology, 24.06.2019 16:50
Ramp charts are generally created in wordlotusexcelpowerpoint
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
English, 02.12.2021 16:40
question
Medicine, 02.12.2021 16:40
question
Mathematics, 02.12.2021 16:40
question
Physics, 02.12.2021 16:40
question
English, 02.12.2021 16:40
question
Business, 02.12.2021 16:40
Questions on the website: 13722360