Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Ineed help on this javascript program 4. Calculate the number of days to the event: Divide the time value difference by the number of milliseconds

image text in transcribedimage text in transcribedIneed help on this javascript program

4. Calculate the number of days to the event: Divide the time value difference by the number of milliseconds in a day. Use the Math.floor) function to reduce the result number to an integer. . 5. Calculate the number of hours, minutes, and seconds in the remaining time value: (a) Mod the time value difference by the number of milliseconds in a day; (b) Divide the mod result by the number of milliseconds in an hour (c) Use the Math.floor) function to reduce the number to an integer for the number of hours: (d) Repeat Steps (a) to (c) to calculate the number of minutes and seconds. You may need to update the calculating formula accordingly. Presentation Figure 2 shows a sample output when running the "Days- To-Go" program. Note that the information should be displayed using the alerTOKYO 2020:872 DAYS 7 HOURS 18 MINS 27 SECS function; wherever possible you should use variables in expres- sions instead of explicit values (e.g.. literals and num- bers), for example, using the variable created for the event name instead of a string value of Tokyo 2020"; OK 'Figure 2: lustration of the Output - the layout of output may vary depending on web Testing Test your program by comparing its calculating results to the Days-To-Go feature on the official website of Tokyo 2020 (https://tokyo2020.org/en/). Note that due to different locality settings on your computer and the Tokyo 2020 server, your calculation result could be slightly different from that shown on the Tokyo 2020 website. For example, in a test when my program said "872 DAYS 22 HOURS" to go,the Tokyo 2020 website showed "872 DAYS 23 HOURS" - Brisbane, Australia is in one hour ahead of Tokyo. Such a difference is not an error and is acceptable.2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

Explain the items reported on a statement of retained earnings.

Answered: 1 week ago