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
Goshia [24]
3 years ago
5

Your task is to write and test a function which takes one argument (a year) and returns True if the year is a leap year, or Fals

e otherwise. The seed of the function is already sown in the skeleton code in the editor. Note: we've also prepared a short testing code, which you can use to test your function. The code uses two lists - one with the test data, and the other containing the expected results. The code will tell you if any of your results are invalid.
Computers and Technology
1 answer:
TiliK225 [7]3 years ago
5 0

Answer:

function isLeapYear( aYear ){

   var confirmYear=  year % 400 === 0 || (year % 100 !== 0 && year % 4 === 0);

   return confirmYear ? True : False;

}

Explanation:

The javascript function above requires an argument which is the year when it is passed, it is analyzed, counting the number of days in that year and a boolean value of true or false is dynamically assigned to the variable 'confirmYear'.

The ternary operator would logically select the right value, which is outputted to the user. To test the function, use the console to call the function with an argument.

console.log( isLeapYear( 1999 ) );

You might be interested in
Suppose we are given an arbitrary digraph G = (V, E) that may or may not be a DAG. Modify the topological ordering algorithm so
lianna [129]

Answer:

Check the explanation

Explanation:

We can utilize the above algorithm with a little in modification. If in each of the iteration, we discover a node with no inward edges, then we we’re expected succeed in creating a topological ordering.

If in a number of iteration, it becomes apparent that each of the node has a minimum of one inward edge, then there must be a presence of cycle in the graph.

So our algorithm in finding the cycle is this: continually follow an edge into the node we’re presently at (which is by choosing the first one on the adjacency list of inward edges to decrease the running time).

Since the entire node has an inward edge, we can do this continually or constantly until we revisit a node v for the first time.

The set of nodes that we will come across among these two successive visits is a cycle (which is traversed in the reverse direction).

3 0
4 years ago
Javier downloads an illustration from an online Image library and modifies it for his purposes. The illustration he downloads is
Kaylis [27]

The three things he needs to do to comply with the terms of the license are:

  1. Permit others to make derivatives of his Image.
  2. Acknowledge the source of his Image.
  3. License his image under identical terms as the illustration he uses.

<h3>What is the Creative Commons Attribution-ShareAlike (CC BY-SA) license?</h3>

This type of license is one that allows the person who requires an image with said license to use it, even modify it so that the resulting image has the deserved attribution to the person who made the original image and that the resulting image has the same license as the original.

For these reasons, it is forbidden for an image resulting from another with the aforementioned license to be placed in an image bank under payment.

If you want to learn more about Creative Commons License, you can visit the following link: brainly.com/question/17496633

8 0
2 years ago
Describe practices that enable software designers to think about using patterns?
prisoha [69]

Answer:

 Firstly, the software designer basically understand the pattern of the system by think with broader perspective. By establish the pattern first design the proper context of the system.

The pattern dependency basically focus on manage the relationship between the different types of the modules. It basically provide the actual guidance which increase the reuse-ability of the module.  

We can also extract the given pattern that from the level of the abstraction and lack cohesion modules are basically difficult to maintain.

5 0
4 years ago
Tipos de lenguajes relacionados con c++?
Ber [7]

Answer:

Programación Java, Programación Python, Ruby

Explanation: Porque ellas son ...

3 0
3 years ago
How to wire two separate switches &amp; lights using the same power source?
Ann [662]
Pull the other end of each cable through the back of the electrical box for the switch<span> that controls it, then strip the end of the cable with a knife and </span>separate<span> the </span><span>wires.

</span>
5 0
3 years ago
Other questions:
  • A database administrator (DBA) must have a clear understanding of the fundamental business of an organization, be proficient in
    11·1 answer
  • which is a set of techniques that use descriptive data and forecasts to identify the decisions most likely to result in the best
    8·1 answer
  • This statement lets the value of a variable or expression determine where the program will 1. switch 2. select 3. associative 4.
    11·1 answer
  • The _______ of a secondary storage device indicates how much data the storage medium can hold.
    13·1 answer
  • When Russ opened a website on his browser, he saw an error that the site was not compatible with the browser version he was runn
    9·1 answer
  • Why was unicode invented?
    10·1 answer
  • When max() function is used on lists of words, what does max() find? For example:
    13·1 answer
  • You have learned a lot about the types of careers that are involved with building a playground. Create two job descriptions of p
    7·2 answers
  • Question 2 (6 points)
    11·1 answer
  • Can someone please help? i am trying to code my raspberry pi pico in python, and it says this is wrong. Can someone help tell me
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!