Question: Write a JAVA application program that will get a line of text containing a date in US form from the user, and then change this

Write a JAVA application program that will get a line of text containing a date in US form from the user, and then change this date to European form.

Begin by asking the user to enter a date in the form of month/day/year. Store this date in a String variable.

Next, use the appropriate String methods to swap the month and day parts of the date, and replace the slash marks with periods. Print the revised String to the screen.

Please note that users are allowed to input the year in two digits or four digits, and input the month and day in one digit or two digits. Your program should be able to handle all possible cases.

The following is an example of what you might see on the screen when your program runs. The exact output depends on the values that the user types in while the program runs. The user's values are shown below in italics:

 Enter a date in the form mon/day/year: 

06/17/2008

 Your date in European form is: 17.06.2008 

Here is another example run:

 Enter a date in the form mon/day/year: 

5/3/09

 Your date in European form is: 3.5.09 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!