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
These operating systems were referred to as command-based.
Doss [256]

{\underline{\boxed{\bf{MS - DOS \:  and \:  UNIX}}}}

3 0
2 years ago
Read 2 more answers
Debug
Snowcat [4.5K]
Wait what’s the question tho??
6 0
3 years ago
How do i switch my level to high school on brainly
Bumek [7]

Edit your profile, click preferences, and then there should be a drop down that has your level on it which you can change.

7 0
3 years ago
Read 2 more answers
Which of the following software is an
krok68 [10]
The answer is B:McAfee
3 0
2 years ago
Read 2 more answers
_ includes websites that encourage interaction and connection among people, businesses, and organizations. A. News sites B. Sear
Dovator [93]
> News sites give information about news or what is trending around the area or world (CNN, Fox, MSNBC, etc) 

> Search engines is what allows you to look up websites (Google, Bing, Yahoo, etc) 

> Social media AKA Social Networking sites is interaction social sites where you connect with various people from around the world. (Facebook, Twitter, Google+, etc)

>Apps is short for applications which is an application that has a specific function (Games, Music, Social networking) 

So based on this, you answer is C. Social Media
6 0
3 years ago
Read 2 more answers
Other questions:
  • Sometimes we write similar letters to different people. For example, you might write to your parents to tell them about your cla
    9·1 answer
  • ________ is a command-line utility installed in the windows\system32 folder that displays information about your windows version
    9·1 answer
  • True / False<br> 1. A byte is a standardized unit of measure that is always 8-bits.
    7·1 answer
  • . Two or more functions may have the same name, as long as their _________ are different.
    9·1 answer
  • What are the differences, physically and logically, between the two printing configurations: Network-attached Printing and Netwo
    7·1 answer
  • In our discussion of Computer Hardware, we talked about three essential hardware components that are there inside every computer
    14·1 answer
  • Categorize each of the following situations as a compile-time error, run-time error, or logical error. Group of answer choices m
    5·1 answer
  • 20 POINTS!!! I NEED HELPP
    6·2 answers
  • How does microsoft label mac addresses in the windows utilities that show you the mac address?
    13·1 answer
  • In addition to good design sense, what else do web designers need to be proficient in?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!