Write a program that reads a string from the keyboard and testswhether it contains a valid date. Display the date and a messagethtat indicates whether it is valid. if its not valid, also displaya message explaining why it is not valid The input date will havethe format mm/dd/yyyy. a valid month value mm must be from 1 to 12(January is 1). The day value dd must be from 1 to a value that isappropriate for the given month. February has 28 days except forleap years when it has 29. a leap year is any year thtat isdivisible by 4 but not divisible by 100 unless it is also divisibleby 400 import java.util.Scanner; public class Ques1 { public staticvoid main(String[] args) { int month, day, year; boolean validDate;System.out.println(“Enter a date (mm/dd/yyyy)”); Scanner read = newScanner(System.in); month = read.nextInt(); day = read.nextInt();year = read.nextInt(); if((month >= 1 && month <= 12)&& (day >= 1 && day . . .
#Sales Offer!| Get upto 25% Off: