PIC40A

Homework 3: Calendar

Due

New due day Feb/16 Wed 5:00pm No late homework will be accepted!
You are not allowed to use any predefined class or function

Assignment

The homework consists of 2 webpages (index.html and index2.html).
The first webpage(index.html) prompts the user to enter 2 a year and a month(1-12) and print out a calendar.
The second webpage(index2.html displays the calendar of Feb 2005. The user can change the background, color, font style.
you are going to write exactly 2 webpages in hw3 foloder. You work can be accessed by http://www.pic.ucla.edu/~YourUserName/hw3/index.html and http://www.pic.ucla.edu/~YourUserName/hw3/index2.html. Notice that no other html file is allowed. You can have any many as gif, or jpg files as you want.
W3 Validation is NOT necessary

index.html

1.
The user access your webpage http://www.pic.ucla.edu/~YourUserName/hw3/index.html.
2.
The user is prompted to enter a year.
[prompt for a year]
3.
If the year is not an integer or is negative. Display a webpage says that the year should be a positive integer. Ask the user to reload the webpage.
4.
The user is prompted to enter a month between 1 and 12
[prompt for a month]
5.
If the month is not an integer between 1 and 12. Display a webpage with error message. Ask the user to reload the webpage.
6.
Display the corresponding calendar with the given year and month.
[Lakers Calendar]
The webpage Your webpage should look simlar to mine but you should use different theme. You can use your favorite background image, color and some other fonts.
You can go to MYUCLA to see different themes

How to find out the day of a week

Main referece source is The Calendar and the Days of the Week
To make your life easier, here is the answer in C++ in a PIC10 HW.
Zeller's Rule

The following formula is named Zeller's Rule after a Reverend Zeller. [x] means the greatest integer that is smaller than x. You can find this number by just dropping everything after the decimal point. For example, [3.79] is 3. Here's the formula:

Now let's substitute our example numbers into the formula.

Once we have found f, we divide it by 7 and take the remainder (if the remainder is negative, add 7). A remainder of 0 corresponds to Sunday, 1 means Monday, etc. For our example, 100 / 7 = 14, remainder 2, so January 29, 2064 will be a Tuesday.

index2.html

1.
The webpage only display the calendar of ONE PARTICULAR MONTH: 2005 Feb.
2.
The user can choose different theme from the menu.
Example,
[Calendar of Feb 2005]
and
[Calendar of Feb 2005]

What to submit

There is nothing to submit. The grader is going to check your webpages
http://www.pic.ucla.edu/~YourUserName/hw3/index.html and http://www.pic.ucla.edu/~YourUserName/hw3/index2.html

Remark

Don't forget to put your honesty pledge inside your file (between <body> and <body/>)
<!--
Name:        Charles Li 
Student ID : 000 000 000   
PIC ID:      ccli 
E-mail:      ccli AT math DOT ucla DOT edu 
Assignment:	 hw1 
I, Charles Li, pledge that this is my own independent work, which  
conforms to the guidelines of academic honesty as described in the course  
syllabus.  
-->