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
An administrator running a port scan wants to ensure that no processes are listening on port 23. What state should the port be i
a_sh-v [17]

Answer: Closed port

Explanation:

Port 23 basically refers to the telnet which provide very severe services and it is used to access the server remotely. We should always closed the port 23, when we are not using telnet services because to prevent it from being hacked due to the port scanning.

As, now a days it is rarely used by the hackers as it is difficult to access this services from the server.

Therefore, Closed port is the correct answer.

3 0
3 years ago
Explain the components of Information System?​
slavikrds [6]

Answer:

An information system is essentially made up of five components hardware, software, database, network and people. These five components integrate to perform input, process, output, feedback and control. Hardware consists of input/output device, processor, operating system and media devices.

Explanation:

7 0
3 years ago
List 1 reason people invest in Cryptocurrency
Katarina [22]

Answer:

The common reason to invest in cryptocurrency is the desire for a reliable, long-term store of value.

Explanation:

8 0
2 years ago
Why is a personal laptop computer NOT a server?
bixtya [17]
I believe the answer is C) <span>servers are used directly by computers, not by people

Have a good day! =)</span>
4 0
3 years ago
Read 2 more answers
Insert a row above the selected row
anastassius [24]
I cants see the "Selected Road" And I cant answer this unless you put that up. Sorry.
6 0
3 years ago
Read 2 more answers
Other questions:
  • The quality of a language that allows a programmer to express a computation clearly, correctly, concisely, and quickly is called
    7·1 answer
  • Given a one dimensional array arr, what is the correct way ofgetting the number of elements in arr
    15·1 answer
  • Businesses use spreadsheets to keep track of financial________.
    14·1 answer
  • In your own words explain how to add footer and head in a word doc.
    10·1 answer
  • If a switch needs to send information to other switches in the network it would send out a ___________.
    7·2 answers
  • 3s X 82 = X +y? is this true
    10·2 answers
  • 3. Choose the statement that best describes a ray. A ray extends forever in both directions. B ray is a part of a line with two
    10·1 answer
  • If you answer I will mark brainliest!!! I want to be able to see two websites on my screen at the same time, how do I do that on
    9·1 answer
  • How would you use keywords and Boolean operators to help you with a web search?
    13·1 answer
  • What is the "Driver's Compact Law"?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!