Write a program that converts date formats from American Format: “February 4, 2021” to International Format, such as “2021-February-4”. Hint: you may use several string methods, including: str.indexOf(c) and str.substring(p, q). Note: java programming, must detect comma
Write a program that converts date formats from American Format: “February 4, 2021” to International Format, such as “2021-February-4”. Hint: you may use several string methods, including: str.indexOf(c) and str.substring(p, q). Note: java programming, must detect comma
Chapter5: Looping
Section: Chapter Questions
Problem 13E
Related questions
Question
Write a program that converts date formats from American Format: “February 4, 2021” to International Format, such as “2021-February-4”. Hint: you may use several string methods, including: str.indexOf(c) and str.substring(p, q).
Note: java
Expert Solution
Step 1
ALGORITHM:-
1. Take the input date.
2. Tokenise it on the basis of whitespace character.
3. Store the day, month & year after tokenising the input date.
4. Remove the comma(,) from the day after tokenising it again on the basis of comma.
5. Print the date in correct format.
6. Finish.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,