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

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 13E
icon
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 programming, must detect comma

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

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,