Programming Examples

Java program to accept date in dd mm yyyy format and check whether it is valid date or not


Design a program which accepts your date of birth in dd mm yyyy format. Check whether the date entered is valid or not. If it is valid, display “VALID DATE”, also compute and display the day number of the year for the date of birth. If it is invalid, display “INVALID DATE” and then terminate the program.

Test your program for the given sample data and some random data.

Example 1 :

INPUT: Enter your date of birth in dd mm yyyy format

05

01

2010

OUTPUT: VALID DATE 5

Example 2 :

INPUT: Enter your date of birth in dd mm yyyy format 03

04

2010

OUTPUT: VALID DATE

93

Example 3 :

INPUT: Enter your date of birth in dd mm yyyy format 34

06

2010

OUTPUT: INVALID DATE

Output

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz