Answer to Question #256971 in Java | JSP | JSF for Write a program th

Question #256971
Write a program that accepts dates written in numerical form and then output them as a complete form. For example, the input:
1
Expert's answer
2021-10-26T10:25:57-0400


import java.util.*;


public class App {


	public static void main(String[] args) {
		Scanner keyBoard = new Scanner(System.in);
		System.out.print("Enter date: ");
		String monthName="";
		int day = keyBoard.nextInt();
		int month = keyBoard.nextInt();
		int year = keyBoard.nextInt();


		switch (month) {
		case 1:
			monthName = "January";
			break;
		case 2:
			monthName = "February";
			break;
		case 3:
			monthName = "March";
			break;
		case 4:
			monthName = "April";
			break;
		case 5:
			monthName = "May";
			break;
		case 6:
			monthName = "June";
			break;
		case 7:
			monthName = "July";
			break;
		case 8:
			monthName = "August";
			break;
		case 9:
			monthName = "September";
			break;
		case 10:
			monthName = "October";
			break;
		case 11:
			monthName = "November";
			break;
		case 12:
			monthName = "December";
			break;
		}
		System.out.printf("%s %d, %d", monthName, day, year);
		keyBoard.close();


	}


}





Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS