1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sergio039 [100]
3 years ago
5

Create an array of 10 fortune cookie sayings that will be randomly displayed each time the user reloads the page. The fortune wi

ll be sayings like: "Procrastination is the thief of time." Let the visitor get a new fortune when a button is clicked. g
Computers and Technology
1 answer:
vfiekz [6]3 years ago
4 0

Answer:

let cookieNumber = Math.floor(Math.random() * 10)

switch (cookieNumber) {

  case 1:

   document.write('Fortune 1')

   break;

  case 2:

   document.write('Fortune 2')

   break;

   case 3:

   document.write('Fortune 3')

   break;

  case 4:

   document.write('Fortune 4')

   break;

  case 5:

   document.write('Fortune 5')

   break;

  case 6:

   document.write('Fortune 6')

   break;

  case 7:

   document.write('Fortune 7')

   break;

  case 8:

   document.write('Fortune 8')

   break;

  case 9:

   document.write('Fortune 9')

   break;

  case 10:

   document.write('Fortune 10')

Explanation:

The cookieNumber is generated using Math.random(), which is rounded to a whole number using Math.floor(). Then, a switch block is used to display a different fortune depending on the value of cookieNumber.

You might be interested in
What command can be used to export an nps backup file named npsconfig.xml that can be used to restore nps configuration on anoth
irakobra [83]

The command is Export-NpsConfiguration    

An admin can export the entire NPS configuration from one NPS for import to another NPS. Standard precautions should be taken when exporting NPS configurations over the network. The command syntax that can be used for exporting the NPS configurations is Export-NpsConfiguration –Path <filename>


3 0
3 years ago
A data visualization tool that updates in real time and gives multiple outputs is called
strojnjashka [21]

Answer:

A data dashboard

Explanation:

3 0
2 years ago
Any suggestions on how to write the following Python code?
Ksju [112]

Answer:

Hi

Explanation:

6 0
3 years ago
Help ME! Will Mark BRAINLIEST! Its Engineering!
Anettt [7]
What is it about ? And what you need help on
5 0
3 years ago
WILL GIVE BRAINLIEST!!!!!!!
stellarik [79]
True











Dhahvdbdbrhhehebdbdbbdbd sorry it has to be longer ahhshdjdjhsjdjdbdnbfbfjfj
7 0
2 years ago
Read 2 more answers
Other questions:
  • ASAP HELP NO GUESS A new pet store wants to design a logo to be displayed on business cards, posters in the shop’s windows, and
    9·2 answers
  • 13. You're expecting an important call from Mr. Suarez, a potential customer. While waiting for this call, your supervisor calls
    15·1 answer
  • 20 Points!! Please hurry!!
    9·1 answer
  • Which do web servers host?<br> Websites<br> Networks<br> Firewalls<br> Zones
    8·1 answer
  • Sonic the Hedgehog (1991)
    14·1 answer
  • If you design your pages using a font that your user does not have installed, the browser defaults to ____ on a macintosh.
    13·1 answer
  • As u type where does excel display the entry
    10·1 answer
  • PLEASE I NEED HELP PLEASE PLEASE<br> Which function prompts the user to enter information?
    9·1 answer
  • There are types of templates​
    5·1 answer
  • Which steps are needed for word to create an index
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!