Answered You can hire a professional tutor to get the answer.

QUESTION

Deliverables:) Write the HTML and JavaScript page described below. Introduction:

Deliverables: To complete this assignment you must -- 1.) Write the HTML and JavaScript page described below.Introduction: The goal of this assignment is to encourage you get comfortable with 2D arrays and indexing schemes.A 3x3 2D array:Arrays can contain anything, even other arrays. In JavaScript, 2D arrays are allocated with a single array, where each element contains an array.Declare a 2D array:var matrix = new Array(numrows);for(row = 0; row < numrows; row++)matrix[row] = new Array(numcols);Elements can be accessed with [] just like with 1D arrays, but since each row in the 2D array contains an array, accessing is with row, then column:matrix[row][col]Initialize a 2D array by iterating over each row and each column:for(row = 0; row < numrows; row++){for(col = 0; col < numrows; col++)matrix[row][col] = #}Procedures:Using your text editor create a new document named "cop2500lab8.html".PART 1:You are to convert a 2d array specification, namely copying writing a Z shape, into a program.Note that the Z can be broken into segments where rows are related to columns in some defined way.Row 0 of Z has all set, just like the last row of the Z.The antidiagonal of the Z is another segment.Discover the relationship between the row and column by examining pairs:row: 0 col: 4row: 1 col: 3row: 2 col: 2...SectionSpecificationCommentsINPUT:M A 5x5 2D arrayINITIALIZATION: Set all elements of M to 0COMPUTATION:1111100010001000100011111Set Z shape to 1, all else leave as 0.OUTPUT: Iterate over rows of M, outputting each row. Display M with document.writePART 2:You are to convert a 2d array specification, namely copying writing an N shape, into a program.Note that the N can be broken into segments where rows are related to columns in some defined way.Column 0 of N has all set, just like the last column of the N.The diagonal of the N is another segment.Discover the relationship between the row and column by examining pairs.SectionSpecificationCommentsINPUT:M A 5x5 2D arrayINITIALIZATION: Set all elements of M to 0COMPUTATION:1000111001101011001110001Set N shape to 1, all else leave as 0.OUTPUT: Iterate over rows of M, outputting each row. Display M with document.writeOpen a browser and verify that the file displays properly.
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question