Jump to content

Math problem by date


jbmanz

Recommended Posts

I want to be able to use the current date to solve a math problem, specifically as follows:If today is March 17, the math problem of the day should be:(Month times Day of Month) + 99 = Answer of the Day(3 x 17) + 99 = 150How can I create a java script to find the current month and the current day of month, multiple those two together, then add 99 and display the answer as a result.

 

Ideally I'd like to embed this into an existing simple html page by referencing the JavaScript "math problem" so when "index.html" is opened, I have a line that shows immediately: "The answer of the day is: X" (or 150 today, etc).

Thank you -- JB

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...