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
1.
natka813 [3]
Its gonna be about 39%.
6 0
3 years ago
A display that is thin flexible, light, and easy to read in all types of light is an
Nuetrik [128]

Answer; Electric Paper Display

Explanation:

<em>"PDs are extremely thin and only require power when a new image is requested. Instead of a traditional display that uses backlighting to illuminate pixels, an EPD is based on the scientific phenomena known as "electrophoresis," the movement of electrically charged molecules in an electric field."</em>

Above is the definition, as you can see it resembles your question greatly so this is most likely the answer you're looking for.

Good luck :D

8 0
2 years ago
Read 2 more answers
¿Cuales son los dos estados de una computadora y que significa cada uno?
hjlf

Answer:

En ciencias de la computación, el estado de un circuito lógico digital o programa de computadora es un término técnico para toda la información almacenada a la que un circuito o programa tiene acceso en un momento dado. La información recibida previamente en las entradas se almacena en la memoria de elementos electrónicos, como disparadores, celdas de memoria. El contenido almacenado de estos elementos de memoria, en un momento dado, denominado colectivamente el "estado" del circuito, contiene toda la información sobre el pasado al que tiene acceso el dispositivo. Así, básicamente, una computadora puede tener acceso a dicho estado o no, según se encuentre encendida o apagada.  

4 0
2 years ago
What is the minimum number of bits required to store 11 different values?
yawa3891 [41]

Answer:

4 bits are required. 4 bits can represent 16 different values (2*2*2*2 or ). 3 bits can only represent 8 different values. In the general case n bits can represent values, or correspondingly m values can be represented by bits.

5 0
3 years ago
Write an awk script that produces a report from an input file. The report summarizes sales data as recorded for sales stations.
Hatshy [7]

Answer:

Script is given below

Explanation:

Below is the AWK code for the Report.I have used the sample data that your have shared in the question.

AWK code-

echo "Hello World!"

echo "2011 Jan X 29.44 17.33 43.21" > inputfile.txt

echo "2014 Jan Y 32.32 12.12 99.00 1.99 " >> inputfile.txt

echo "2012 Jan X 321.11 12.34 10.99" >> inputfile.txt

echo "2012 Feb Y 1.99 12.75" >> inputfile.txt

echo "2012 Feb X 32.99 65.78 98.76" >> inputfile.txt

echo "2014 Jan Y 12.99 17.44 21.34" >> inputfile.txt

echo "2012 Mar X 11.45" >> inputfile.txt

awk -F" " 'BEGIN{ X_sum=0;

print(" Sales Data for year 2014")

print("========================")

}

{ if($1=="2014")

{

print($2,":", $4+$5+$6+$7+$8+$9+$10+$11+$12+$13)

}

if($3=="X")

{

X_sum=X_sum+$4+$5+$6+$7+$8+$9+$10+$11+$12+$13

}

if($3=="Y")

{

Y_sum=Y_sum+$4+$5+$6+$7+$8+$9+$10+$11+$12+$13

}

if($3=="Z")

{

Z_sum=Z_sum+$4+$5+$6+$7+$8+$9+$10+$11+$12+$13

}

 

}

END { print(" ========================")

print("Station volume for 2014 is:")

print("X:" ,X_sum )

print("Y:" ,Y_sum )

print("Z:" ,Z_sum )

}

' < inputfile.txt

8 0
3 years ago
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
  • Principles of defensive driving include:
    15·1 answer
  • What document type would be best to communicate sales items from a business to potential customer?
    12·1 answer
  • What should a safe username do?
    14·2 answers
  • Once a virus has been removed by your anti-virus program, all traces of it are gone from your computer.
    9·1 answer
  • You want to create Web pages that can easily adapt to and serve multimedia content to smartphones, tablets, gaming devices and s
    13·1 answer
  • The only way to print a photo is on a special glossy paper using professional printing services in a store
    9·2 answers
  • Write the sum of products, the canonical product of sums, theminterm shorthand and the maxterm shorthand for the following:
    6·1 answer
  • Your computer is taking longer than usual to open files and you notice that your hard drive light stays on longer than usual whi
    9·1 answer
  • Define computer architecture?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!