Pascal Calendar

I have a project to do in my Pascal class. I sure could use a little help on this. What I need to do is write a program that asks the user for a month, year, and what day of the week Jan 1 was for the selected year. The only years I'll need to be concerned with are 1900-2100 inclusive.
In addition, the project requires me to create a grid with text mode to display the selected month.
I could really use a little help on this project!

Comments

  • : I have a project to do in my Pascal class. I sure could use a little help on this. What I need to do is write a program that asks the user for a month, year, and what day of the week Jan 1 was for the selected year. The only years I'll need to be concerned with are 1900-2100 inclusive.
    : In addition, the project requires me to create a grid with text mode to display the selected month.
    : I could really use a little help on this project!

    A little help with what? How far have you gotten with the project, and what exactly are you stuck on? You need to help us help you :)
  • : : I have a project to do in my Pascal class. I sure could use a little help on this. What I need to do is write a program that asks the user for a month, year, and what day of the week Jan 1 was for the selected year. The only years I'll need to be concerned with are 1900-2100 inclusive.
    : : In addition, the project requires me to create a grid with text mode to display the selected month.
    : : I could really use a little help on this project!
    :
    : A little help with what? How far have you gotten with the project, and what exactly are you stuck on? You need to help us help you :)
    :
    I have determined the leap years for the years in question, defined the amount of days per month, and have created the grid. What I'm having trouble with is populating the grid with the dates for the month selected. The grid is a procedure that I call, but it appears empty with only the month, and year of the users choice at the top. How can I get the dates to appear within the grid?

  • : : : I have a project to do in my Pascal class. I sure could use a little help on this. What I need to do is write a program that asks the user for a month, year, and what day of the week Jan 1 was for the selected year. The only years I'll need to be concerned with are 1900-2100 inclusive.
    : : : In addition, the project requires me to create a grid with text mode to display the selected month.
    : : : I could really use a little help on this project!
    : :
    : : A little help with what? How far have you gotten with the project, and what exactly are you stuck on? You need to help us help you :)
    : :
    : I have determined the leap years for the years in question, defined the amount of days per month, and have created the grid. What I'm having trouble with is populating the grid with the dates for the month selected. The grid is a procedure that I call, but it appears empty with only the month, and year of the users choice at the top. How can I get the dates to appear within the grid?
    :
    :
    By a careful application of for-do loops, write()'s, and writeln()'s. Here is an example of a 5x6 grid:
    [code]
    for row := 0 to 5 do begin
    for col := 1 to 5 do begin
    if row*5+col<10 then { if 1 digit number }
    write('0', row*5+col, ' ') { add a zero before it }
    else
    write(row*5+col, ' '); { else just show it }
    end;
    writeln; { next row }
    end;
    [/code]
    This code doesn't keep track of weekdays, but with some thought, math and if-then's you should be able to work that out as well.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories