Question: Please write JavaScript code for the four exercises listed below. Be sure to document your work with comments for code management. For each problem, describe

Please write JavaScript code for the four exercises listed below. Be sure to document your work with comments for code management. For each problem, describe your solution in English - as a set of JavaScript comments.

Exercise 1 - Display a Triangle

Write a loop that makes seven calls to output the following triangle:

Please write JavaScript code for the four exercises listed below. Be sure

Exercise 2 - FizzBuzz

Write a program that prints all the numbers from 1 to 100, with two exceptions. For numbers divisible by 3, print "Fizz" instead of the number, and for numbers divisible by 5 (and not 3), print "Buzz" instead.

Exercise 3 - Modify FizzBuzz

Modify the FizzBuzz program to print "FizzBuzz" for numbers that are divisible by both 3 and 5 (and still print "Fizz" or "Buzz" for numbers divisible by 3 or 5, respectfully.)

Exercise 4 - Chessboard

Write a program that creates a string that represents an NN grid, using newline characters to separate lines. At each position of the grid there is either a space or a "#" character. The characters should form a chessboard. (Output should show something like the image below.) Prompt for a value so that the program works for any size, outputting a grid of the given width and height.

to document your work with comments for code management. For each problem,

Transcribed image text

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!