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]
2 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]2 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
A user has a network device that streams media to the LAN. The device is visible on the network. All PCs on the LAN can ping the
trasher [3.6K]

Answer: A. Multicast

Explanation:

Here we are given a situation where it is necessary for the device to stream media to all the PCs connected across the LAN. But as the they are unable to stream the media then it is a problem in the multicast TCP/Ip technology.

Multicasting enables to transfer information or messages from one to many or many to many. Here as a single device is responsible for streaming the content to other PCs across the LAN, therefore it is necessary that multicast has been properly implemented.

Option B is incorrect as it is not a scenario of broadcast as in broadcasting all the receivers must get the streaming however here if a PC does not want to receive the media stream it cannot receive for which multicasting is required.

Option C is incorrect as here we are not talking of one to one communication.

Option D is incorrect as here we cannot have more than one route to send the media content except the LAN.

5 0
3 years ago
Your company is trying to get out of the responsibility of purchasing and hosting its own hardware so it won’t have to finance o
kotykmax [81]
The answer is Software as a Service (SaaS).

SaaS is one of the 3 main categories of cloud computing. In SaaS, a 3rd party provider hosts applications and make them available to customers over the internet. It removes the need for businesses to install and run applications on their own data centers or computers. It also eliminates the expense of hardware acquisition and maintenance, as well as software installation and support.
7 0
3 years ago
Read 2 more answers
What is the interface in Java programming Language? Why do we need to use it?
Alenkasestr [34]

To accustom to several different language-speaking countries. One program is often used internationally so having a language setup is very important.

6 0
3 years ago
What is the differnce between ''P4 and 4P''
34kurt
The number and letter are switched. This question needs more context to get a accurate answer.
5 0
3 years ago
Read 2 more answers
...............................
Gemiola [76]

............................

Mark me brainliest^^

7 0
2 years ago
Read 2 more answers
Other questions:
  • A user reports that nothing happens when he or she attempts to print from the computer at his desk. This points to a possible pr
    11·2 answers
  • Megan has written the following rough draft for her assignment. Choose the correct way to complete each sentence. Sarah is creat
    13·1 answer
  • You are building a gaming computer and you want to install a dedicated graphics card that has a fast gpu and 1gb of memory onboa
    15·2 answers
  • What year did buck tooth bob become famous
    11·2 answers
  • How should font appear in a slide presentation compared to the font in a document
    7·1 answer
  • In the event you get pulled over for a traffic stop, describe the situation from the police officer's perspective and list at le
    6·2 answers
  • Que se puede observar en el escritorio de windows
    8·1 answer
  • What happens to a message when it is deleted?
    11·1 answer
  • How does the computer help me with school work
    5·2 answers
  • What kind of goal does ariel set when he works to graduate from high school in four years? short term long term normative fantas
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!