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
The CPU converts into information. The CPU is the mastermind of the computer, controlling everything that goes on through a seri
Harman [31]

Answer:

Mathematical sequences

Explanation:

Just did it

5 0
3 years ago
Read 2 more answers
How many bits can a memory chip with the below configuration support? For full credit, show how you got the answer.
tatiyna

Answer:

Total Memory= 4 KB = 4096 bytes = 32768 bits

Explanation:

<em><u>1. Data lines are 8 From D0 to D7</u></em>

so

Total memory at single address locations is 8 bits.

<em><u>2. Address lines are 12 (A0 to A11)</u></em>

There are 12 address lines but 3 out 12 are for selction of chip or memory bank.

so only 9 pins are there to address the locations on one chip.

Total No. of address locations on single chip = 2^9 = 512 locations

as 1 location is 1 byte so total memory of single chip is 512 bytes.

<u><em>3. Total Memory Bank </em></u>

There are total 3 selection pins for memory bank.

so

Total chips = 2^3 = 8.

<em><u>4. Total Memory </u></em>

Total size of 1 chip = 512 bytes

Total size of 8 chip = 8x512 bytes = 4096 bytes = 4096/1024 kb = 4 kb

<em>So total memory of system is 4 Kb = 4096 bytes = 32768 bits</em>

5 0
3 years ago
A(n) ________ is a chart based on PivotTable data.
Mrrafil [7]
Well since it’s a chart based on a PivotTable prettyyyy sure it’s gonna be a PibltChart
7 0
2 years ago
How do I change the year I was born on this website? I made a mistake and now I can't fix it. Can somebody please help me?
Eddi Din [679]

Answer:

you can go to settings and try to fix it or contact the people of this website

Explanation:

8 0
3 years ago
When summarizing graphs of categorical​ data, report the​ _______ and describe the​ _______?
Alex_Xolod [135]
Hello <span>Rouahidy7821 
</span><span>

Answer: When summarizing graphs of categorical​ data, report the​ models and describe the​ </span><span>variability. 
</span>
Hope this helps
-Chris
7 0
3 years ago
Other questions:
  • Why isn't my rank move from ambitious to virsto i met all the requirements
    8·2 answers
  • write an algorithm that gets the price for item A plus the quantity purchased. The algorithm prints the total cost, including a
    5·1 answer
  • Most Microsoft Windows fatal errors (blue screen of death) are caused by:
    14·1 answer
  • 0.005098 megaliters to liters. record your answer in whole liters
    7·1 answer
  • What is the name of the process that weighs the alternatives, gathers all necessary information, and can ultimately lead you to
    9·2 answers
  • What technology did one of the student's have to learn to use in order to help him with his homework in the film, "Disconnected:
    11·2 answers
  • An analogue sensor has a bandwidth which extends from very low frequencies up to a maximum of 14.5 kHz. Using the Sampling Theor
    9·2 answers
  • Define a query that uses the Natural Join command to join three tables to produce useful information.
    14·1 answer
  • _________ is the most popular high-level Java API in Hadoop Ecosystem. Cascading Scalding Cascalog None of the options
    7·1 answer
  • Think of some local businesses that have websites. Look online and identify two different websites for businesses or services in
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!