Part A - Leap Years Write a function that accepts a year, and works out whether if a given year is a leap year (returning true if it is a leap year and false if it isn't). A normal year has 365 days, leap years have 366, with an extra day in February. This is how to work out whether if a particular year is a leap year: A year is a leap year if it is evenly divisible by 4; except if that year is also evenly divisible by 100 but not 400; Call the function and with the result use a string template literal to print out a sentence including the year, and if it is a leap year or not. Part B - Pyramid Building Write a function that accepts a number (the height of the pyramid), and creates an array of strings where each string represents a level in the pyramid. Each block in the pyramid is represented by the @ character. The array should be returned from the function and printed to the console. So for example a pyramid of 3 levels would look like: [ ] II II @ II II @@@ 'CEEEE" and a pyramid with 5 levels would look like: [ II II @ @ee II II ] eeeee II "eeeeeeeee" Micro
Part A - Leap Years Write a function that accepts a year, and works out whether if a given year is a leap year (returning true if it is a leap year and false if it isn't). A normal year has 365 days, leap years have 366, with an extra day in February. This is how to work out whether if a particular year is a leap year: A year is a leap year if it is evenly divisible by 4; except if that year is also evenly divisible by 100 but not 400; Call the function and with the result use a string template literal to print out a sentence including the year, and if it is a leap year or not. Part B - Pyramid Building Write a function that accepts a number (the height of the pyramid), and creates an array of strings where each string represents a level in the pyramid. Each block in the pyramid is represented by the @ character. The array should be returned from the function and printed to the console. So for example a pyramid of 3 levels would look like: [ ] II II @ II II @@@ 'CEEEE" and a pyramid with 5 levels would look like: [ II II @ @ee II II ] eeeee II "eeeeeeeee" Micro
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter3: Working With Large Worksheets, Charting, And What-if Analysis
Section: Chapter Questions
Problem 2.2EYK
Related questions
Question
Finally, your going to write several small javascript functions to practice with javascript core
![Part A - Leap Years
Write a function that accepts a year, and works out whether if a given year is a leap year (returning true if it is a
leap year and false if it isn't). A normal year has 365 days, leap years have 366, with an extra day in February.
This is how to work out whether if a particular year is a leap year:
A year is a leap year if it is evenly divisible by 4;
except if that year is also evenly divisible by 100 but not 400;
Call the function and with the result use a string template literal to print out a sentence including the year, and if
it is a leap year or not.
Part B - Pyramid Building
Write a function that accepts a number (the height of the pyramid), and creates an array of strings where each
string represents a level in the pyramid. Each block in the pyramid is represented by the @ character. The array
should be returned from the function and printed to the console.
So for example a pyramid of 3 levels would look like:
[
]
II
II
@
II
II
@@@
'CEEEE"
and a pyramid with 5 levels would look like:
[
II
II
@
@ee
II
II
]
eeeee
II
"eeeeeeeee"
Micro](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F92e5c125-0162-44af-aecb-b4cf9027a9d3%2Fa20390b6-2dfa-4f9d-8c5e-0c249a1fbb9c%2F8fq208_processed.png&w=3840&q=75)
Transcribed Image Text:Part A - Leap Years
Write a function that accepts a year, and works out whether if a given year is a leap year (returning true if it is a
leap year and false if it isn't). A normal year has 365 days, leap years have 366, with an extra day in February.
This is how to work out whether if a particular year is a leap year:
A year is a leap year if it is evenly divisible by 4;
except if that year is also evenly divisible by 100 but not 400;
Call the function and with the result use a string template literal to print out a sentence including the year, and if
it is a leap year or not.
Part B - Pyramid Building
Write a function that accepts a number (the height of the pyramid), and creates an array of strings where each
string represents a level in the pyramid. Each block in the pyramid is represented by the @ character. The array
should be returned from the function and printed to the console.
So for example a pyramid of 3 levels would look like:
[
]
II
II
@
II
II
@@@
'CEEEE"
and a pyramid with 5 levels would look like:
[
II
II
@
@ee
II
II
]
eeeee
II
"eeeeeeeee"
Micro
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images

Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L

C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L

C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage