nikitacg
02-02-2003, 06:03 AM
:confused:
I have to do this task if anyone can halp me this is task:
Task 2
Alert a random message depending on the time of day, followed by writing each word of the message on individual lines in the browser window.
Criteria
· Create 3 arrays (morning, afternoon and evening) Insert 4 multi-word sentences in each array
· Use the Math.random() method to generate a number
· Depending on the time of day, greet the user with the appropriate random message from the appropriate array
· Time of the day to be 00:00 – 11:59=morning. 12:00 – 18:00=afternoon, and the remainder=evening
· Pass the random message (string) as a value to function that incorporates a for loop . The loop will split the string at every space character and write each word on it’s own line within the browser window
· Make use of the date, string, Math and array objects
· Make use of a function and value passing
Morning
("Good Morning, what a great day for work","Just think, another day another dollar","Be cheerfull on this lovely moring,atleast pretend","Good Morning, now get to work","Remember to have your morning coffee"
Afternoon
("Good Afternoon, have u had lunch","Don't forget our daily afternoon sessions at 3:00pm","It's a nice afternoon isn't it","Shake away those afternoon blues")
Evening
("Good evening to you","In it for the overtime are we? Haha","Yor wife or husband must feel lonely","Reminder evening news at 10:pm")
THANK YOU !!!
I have to do this task if anyone can halp me this is task:
Task 2
Alert a random message depending on the time of day, followed by writing each word of the message on individual lines in the browser window.
Criteria
· Create 3 arrays (morning, afternoon and evening) Insert 4 multi-word sentences in each array
· Use the Math.random() method to generate a number
· Depending on the time of day, greet the user with the appropriate random message from the appropriate array
· Time of the day to be 00:00 – 11:59=morning. 12:00 – 18:00=afternoon, and the remainder=evening
· Pass the random message (string) as a value to function that incorporates a for loop . The loop will split the string at every space character and write each word on it’s own line within the browser window
· Make use of the date, string, Math and array objects
· Make use of a function and value passing
Morning
("Good Morning, what a great day for work","Just think, another day another dollar","Be cheerfull on this lovely moring,atleast pretend","Good Morning, now get to work","Remember to have your morning coffee"
Afternoon
("Good Afternoon, have u had lunch","Don't forget our daily afternoon sessions at 3:00pm","It's a nice afternoon isn't it","Shake away those afternoon blues")
Evening
("Good evening to you","In it for the overtime are we? Haha","Yor wife or husband must feel lonely","Reminder evening news at 10:pm")
THANK YOU !!!