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
Fair use allows individuals to break copyright so long as they ________.
Iteru [2.4K]
Can prove they are not infringing on copyright
4 0
3 years ago
are designed to locate information based on the nature and meaning of Web content, not simple keyword matches Select one: a. Cra
san4es73 [151]

Answer: C. Semantic Search Engines

Explanation:

Semantic search is simply search with meaning. It is designed to locate information based on the nature and meaning of Web content, not simple keyword matches (like in lexical searches)

4 0
3 years ago
What component uses thermal paste to attach the heat sink?
natka813 [3]

Answer:

Thermal Compound/Thermal Grease

Explanation:

Thermal compound, also known as thermal paste and thermal grease, is a material used to fill the microscopic gaps between a computer's CPU and its heat sink. Thermal compound significantly increases the heat sink's ability to cool the CPU, allowing the CPU to run at a higher speed and improve system performance.

6 0
3 years ago
Capacity requirements are computed by multiplying the number of units scheduled for production at a work center by the:
podryga [215]

Answer:

.

Explanation:

5 0
3 years ago
HURRY PLS
gogolik [260]

Answer:

the testing team

Explanation:

because even though she may have fulfilled the requirements but she still need to test if it runs perfectly or not

7 0
1 year ago
Other questions:
  • What type of devices are the key board and the mouse?
    10·1 answer
  • You're browsing the Internet and realize your browser is not responding. Which of the following will allow you to immediately ex
    5·2 answers
  • Writers should avoid jargon because jargon ______. a. Takes too long to use b. Limits what ideas can be explored c. Conveys too
    12·1 answer
  • Which sentences in the passage correctly describe a function?
    11·1 answer
  • Your essay is due tomorrow and you don't have time to write it. You decide to buy an essay online. You've paid for it, so it can
    12·1 answer
  • Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. Promp
    10·1 answer
  • Is it possible to have a deadlock involving only oneprocess? Explain your answer.
    11·1 answer
  • Wha are the types of slide show? define​
    10·1 answer
  • Most cell phones and tablets have solid-state storage drives. internal hard disk drives. internal cloud storage. external hard d
    7·1 answer
  • The principle of ________ strongly suggests that programs should execute with the least amount of privileges needed to complete
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!