Program to tell the date after some days from the beginning of the year.
Write a program to input a long integer date not less than 5 digits. If data is <5 then prompt the user to reenter. In the input last four digits represent the year and the remaining digits of the number as the days from the starting from the year. Your program displays actual data(using no. of days extracted) followed by month name and year. Leap years are to be taken care of and days may exceed >365 that is the next year may appear. Example: 272008 Output: 27 January 2008 Example: 802005 21 March 2005 Example: 7342005 4 January 2007 import java.io.*; public class YearDate { public void work() throws IOException { String yr, ds, s; long yrs, days, date; yr = ds = s = ""; yrs = days = date = 0; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); for (;;) { System.out.print("Enter the number: "); s = br.readLine(); date = Long.parseLong(s); yr = s.substring(s.length() - 4); ds = s.substring(0, s.length() - 4); yrs = Long....