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
12. Because Java byte code is the same on all computers, compiled Java programs a. are nonexistent b. must be re-compiled for ea
GenaCL600 [577]

Answer:

C) Highly portable

Explanation:

This means they can run on any computer or platform that supports Java without the need for recompillation.

This idea is popularly called WORA that is Write Once Run Anywhere.

Software Applications written in Java are compiled to bytcode (.class) which are intended to run on the Java Virtual Machine (JVM) irrespective of the architecture of the computer or device.

5 0
3 years ago
What is displayed on the console when running the following program?
uranmaximum [27]

I guess there should be the program code in your question. I presume that the complete version of your question is the following:

What is displayed on the console when running the following program?

public class Test {

 public static void main(String[] args) {

   try {

     System.out.println("Welcome to Java");

     int i = 0;

     int y = 2 / i;

     System.out.println("Welcome to HTML");

   }

   finally {

     System.out.println("The finally clause is executed");

   }

 }

}

A.  Welcome to Java, then an error message.

B.  Welcome to Java followed by The finally clause is executed in the next line, then an error message.

C.  The program displays three lines: Welcome to Java, Welcome to HTML, The finally clause is executed, then an error message.

D.  None of the above.

Answer to the complete question with explanation:

B.     Welcome to Java followed by The finally clause is executed in the next line, then an error message

After entering <em>try/catch</em> block program will output <em>"Welcome to Java"</em>.

Then <em>ArithmeticException</em> will be raised at line:

<em>int y = 2 / i;</em>

The reason is division by <em>0</em> because <em>i = 0</em>.

After that <em>finally</em> clause will be executed despite exception thrown which will output <em>"The finally clause is executed"</em>.

There could be a chance that you have modified answers to your question. In that case:

Answer to the original question:

a. Welcome to Java,

c. The finally clause is executed, then an error message.

7 0
3 years ago
The main reason for using a comment in your HTML code is to
zvonat [6]

Answer:

D, document and explain parts of code

Explanation:

Mark me brainliest :)

8 0
2 years ago
There are some practices that result in discrimination but may not look discriminatory at first glance. If a company only hires
den301095 [7]

Answer:

The correct answer to the following question will be "Adverse impact ".

Explanation:

An unintentional and unpredictable consequence of a specific action being taken. In the background of the job choices for firms, corresponds to an imbalance in recruiting or promotional selection that favors instances of a given group or ethnicity.

  • Several behaviors contribute to oppression but might not, at first sight, seem oppressive.
  • Unless a firm recruits only members of the family and community mates, it can unwittingly exclude other ethnicity categories.

3 0
3 years ago
As a project manager, why is analysis an important aspect of the job? Clarify the value of teamwork List the benefits of brainst
kozerog [31]

Answer:

Analysis is an important aspect of the job because it makes proper decision making process.

The values of teamwork are to find the best solution to problems and motivate the whole team.

The benefits of brainstorming include outside input, idea building, routine breaks, .etc...

The advantages of project planning are:

  • Team members become responsible for tasks assigned to them
  • Planning is required so that labor, finance and time resources can be thoroughly considered, including the risk of project delays due to some members working on several projects at the same time
  • Allowance for contingencies should be included in project plans so that if and when they arise, risk mitigation strategies are ready.
  • With a clear direction to follow, team members don’t get sidetracked by their own ideas.

Explanation:

8 0
3 years ago
Other questions:
  • GIVING BRAINLIEST What does output allow a computer to do? Display information Receive information Do complex math problems Do m
    6·2 answers
  • Where does the computer store instructions and data that are needed frequently by the cpu?
    11·1 answer
  • In the game of economics, producers look to technological improvements to increase which of the following?
    7·2 answers
  • Programmers refer to a sequence of characters as a ____.
    12·1 answer
  • ¿dispositivos de hardware Que permite identificar la huella digital registrada por el usuario?
    11·1 answer
  • Clunker Motors Inc. is recalling all vehicles from model years 2001-2006. Given a variable modelYear write a statement that prin
    9·1 answer
  • ​ In the U.S., a work that was created in 2000 by an individual author who died in 2005 will be protected by copyright until ___
    5·2 answers
  • What does a mother board in a computer do?
    11·1 answer
  • Solve<br><img src="https://tex.z-dn.net/?f=%20%5Csqrt%7B3%20%2B%20%20%5Csqrt%7B3x%20%2B%202%7D%20%7D%20%20%3D%202" id="TexFormul
    8·1 answer
  • _______________ provides options for getting access to your old password or resetting the account to a temporary password; users
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!