Hey guys help is much appreciated...I attempted it but its really hard as i am new to programming and only joined my class recently i'd like to get these answered correctly by some one really good at this stuff so i can then review it and learn from it,I'm willing to donate some money to a kind enough gentleman or lady
Pretty please
Here are the Q's
Q1 Using the method header
public void monthName(int month)
{
// put your code here
}
Supply the code to display (using System.out.println) the name of the month on the screen. The method is passed an integer in the range 1 to 12. The number identifies a particular calendar month.
Q2 Alter your answer to Q1 so that the method returns the name of the month instead of displaying it.
Q3 Using the method header
public void dayName(int dayNum)
{
// put your code here
}
Supply the code to display (using System.out.println) the name of the day on the screen. The method is passed an integer in the range 0 to 6. The number identifies a particular day of the week. Thursday is day 0; Friday is day 1; etc.
Q4 Alter your answer to Q3 so that the method returns the name of the day instead of displaying it.
Q5 Using the method header
public int daysInMonth(int month, int year)
{
// put your code here
}
Supply the code to return the number of days in the month. (FYI, the days in each month are 31, 28/29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31.) The method is passed two integers. The first is an integer in the range 1 to 12 which identifies the month. The second is an integer representing the year.
Q6 Consider a calendar year as a series of days numbered from 1 to 365/366. For example, 1-Jan-2011 is day 1 in the year 2011; 21-Jan-2011 is day 21 of that year; 1-Feb-2011 is day 32; 14-Feb-2011 is day 45; and so on. Using the method header
public int serialNumberInYear(int day, int month, int year)
{
// put your code here
}
Supply the code to return the serial number of a particular day (identified by its date) in the year.
Q7 Using the method header
public int leapYearsBetween(int startYear,int endYear)
{
// put your code here
}
Supply the code to return the number or count of leap years between a startYear and endYear - inclusive.
Q8 (NOTE: This question is like Q6 except that it involves more than one year.) Say we select a particular date as our base date or starting date for recording time. For example, say we decide to use 1-Jan-1970 as our base date. Now each day after that date has a serial number. For example, 1-Jan-1970 is day 1; 21-Jan-1970 is day 21; 1-Feb-1970 is day 32; 1-Jan1971 is day 366 (because 1970 was NOT a leap year); and so on. Using the method header
public int serialNumberFromBase(int day, int month, int year)
{
// put your code here
}
Supply the code to return the serial number of a specified date. Use 1-Jan-1970 as the base date.
Q9 Given two dates since 1-Jan-1970 supply the code to return the number of days between them. Use the method header
public int daysBetween(int d1,int m1,int y1,int d2, int m2,int y2)
{
// put your code here
}
Q10 Given a date supply the code to return the number of milliseconds that have elapsed since 1-Jan-1970 up to, but NOT including, the specified date. Use the method header
public int millisecondsUpTo(int day,int month,int year)
{
// put your code here
}