Search:

Type: Posts; User: Norm

Search: Search took 0.22 seconds.

  1. Re: How can I determine what day of the week a given month falls on in Java without using the Calendar Object?

    Those statements will give you the days for the month. There is no need to do a sum.
    Create a method that returns the days for a month with those if statements.
    The valid months are 0 to 11. ...
  2. Re: How can I determine what day of the week a given month falls on in Java without using the Calendar Object?

    Yes,
  3. Re: How can I determine what day of the week a given month falls on in Java without using the Calendar Object?

    How about a list of if statements that adds the days in month to a total depending on if selected month is greater than this month's id.
    Can you use the accumulated number of days in the program? ...
  4. Re: How can I determine what day of the week a given month falls on in Java without using the Calendar Object?

    Put the days/month in a 12 element array. If past Feb add 1 for leap year
    Or have put accumulative days in array to save having to sum them.
  5. Re: How can I determine what day of the week a given month falls on in Java without using the Calendar Object?

    Yes.
  6. Re: How can I determine what day of the week a given month falls on in Java without using the Calendar Object?

    Ok, so only for 2018 and Jan 2018 starts on Monday.

    To get the DoW for Feb 1, use modulus 7 on the days in January and add that to Monday. Continue month by month to the desired month.
  7. Re: How can I determine what day of the week a given month falls on in Java without using the Calendar Object?

    That doesn't answer my questions. Your user input does not have the year for month to display.
    To be able to find the DoW that a selected month in a year starts on I think you need a base date to...
  8. Re: How can I determine what day of the week a given month falls on in Java without using the Calendar Object?

    What is the program's input? For example Month and year?
    What is a data point that anchors the calendar? A DoW for a given Month and year. For example: Nov 1978 starts on a Wednesday.
  9. Re: How can I determine what day of the week a given month falls on in Java without using the Calendar Object?

    Are you asking what DoW the first day in a month in a given year starts on?
    For example Nov 1978 starts on a Wednesday.

    First work out the algorithm, then write the code based on that.
Results 1 to 9 of 9