Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Dates

love236
love236 


please see description in attached file thank you Attachments Tags
Clarifications

Answers

Answer for Assignment 8

mariobeka
mariobeka 



Below you'll find the java code for Birthday, Date and DateTest together with two .txt files containing the results. Attachments
Birthday.java (2 K) Download Preview
day = input.nextInt(); int year = input.nextInt(); TeacherDate date = new TeacherDate(year, month, day); TeacherDate today = new TeacherDate(); System.out.println("You were born on " + date.toString() + ", which was a " + date.getDayOfWeek() + "."); if (date.getDay() == today.getDay() && date.getMonth() == today.getMonth()) { System.out.println("Happy Birthday! You are now

Date.java (2 K) Download Preview
the day. return this.daysInWeek[this.dayOfWeekIndex]; } // isLeapYear() returns whether year is leap year or not public boolean isLeapYear() { if ((this.year % 4 == 0) && (this.year % 100 != 0) || (this.year % 400 == 0)) { return true; } else { return false; } } // nextDay() returns

TeacherDate.java (4 K) Download Preview
4, 5, 6, 7, 8, 9, 10, 11, 12 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, }; // Helping method; returns the number of days since the epoch (1/1/1730). public static int getDaysSinceEpoch() { return (int) ((System.currentTimeMillis() + TimeZone.getDefault().getRawOffset()) / 1000 / 60 / 60

TestDate.java (2 K) Download Preview
int year = input.nextInt(); Date date = new Date(year, month, day); Date today = new Date(); System.out.println("You were born on " + date.toString() + ", which was a " + date.getDayOfWeek() + "."); if (date.getDay() == today.getDay() && date.getMonth() == today.getMonth()) { System.out.println("Happy Birthday! You are now age " +

Birthday.txt (1 K) Download Preview
2013 ——————————————————————————————————————————— What month, day, and year were you born? 10 26 1990 You were born on 1990/10/26, which was a Friday. Happy Birthday! You are now age 23 It will be your birthday in 365

TestDate.txt (1 K) Download Preview
Birthday! You are now age 23 It will be your birthday in 365 days. You are 8401 days old. What month, day, and year were you born? 12 3 1988 You were born on 1988/12/3,

Screenshots
Purchase Answer