| 1: || |
| 2: || |
Create an associative array called colors . Each element of the array is a string representing the color , e.g., red or blue . Use the for/in loop to view each element of the array with a color of the font the same color as the value of the array element being displayed.
| 3: || |
Create a function that will return the current month by its full name . Use the Date object to get the current month. Months are returned as 0 for January, 1 for February, 2 for March, etc. Output should resemble:
The current month is January.
Hint: You can create an array, starting at index 0, and assign a month value to it; e.g., month="January" or use a switch statement, e.g., case 0: return "January" .
| 4: || |
An invoice is due and payable in 90 days. Write a function that will display that date.
| 5: || |
How many days until your birthday? Write a function to calculate it.
| 6: || |
To calculate the balance on a loan, the following formula is used:
PV = PMT * ( 1 “ (1 + IR ) “NP ) / IR
| 7: || |
Using the formula to calculate the loan balance from the last exercise, write a function that will calculate the principle balance left on a loan where the monthly payments are $600, the annual interest rate is 5.5%, and there are 9 years remaining on the loan. Use the toFixed() Number method to format the output.
| 8: || |
Apply the ceil(), floor() , and round() methods to the number 125.5567 and display the results.
| 9: || |
Create an array of 10 fortune cookies that will be randomly displayed each time the user reloads the page.
| 10: || |
Create a string prototype that can be used to create an italic, Verdana font, point size 26.
| 11: || |
Calculate the circumferance of a circle using the Math object.
| 12: || |
| 13: || |
Use the Date object to print today's date in this format:
Today is Friday, June 16, 2003.
Calculate and display the number of days until your next birthday.
Create a prototype for the Date object that will print the months starting at 1 instead of 0.
| 14: || |
Create a String object containing "Jose lived in San Jose for many years."
Find the index for the second Jose .
Get the substring ear from years .
Display the string in a blue, italic font, point size 12, all uppercase.