subject

Define the class Grid, which is an abstraction of a game board, like a chess board. The Grid class has one private data field which is a 10 by 10 two-dimensional array of integer data type [2pts]. Include a no-argument constructor that initializes all the elements of the array to zero [1 pts]. The Grid class has a get function that returns the element at row i and column j of the array, the row and the column are passed as parameters to the get function [2pts]. The class must also have a set function that sets the element at row i and column j of the array to a given value. The row and the column as well as the new value are passes as parameters to the set function [2ts]. Write a main function in which an object of the type Grid is created, then print the value of the element in location (3, 5), next set the value of the element in location (3, 5) to 100 and print the new value . Code submission and proper run results [3pts].

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
Answers: 1
question
Computers and Technology, 24.06.2019 02:30
Assume a class window with accessor method getwidth that accepts no parameters and returns an integer. assume further an array of 3 window elements named winarr, has been declared and initialized. write a sequence of statements that prints out the width of the widest window in the array.
Answers: 2
question
Computers and Technology, 24.06.2019 03:00
Click the "draw structure" button to activate the drawing utility. draw two diastereomers of (1z,4r)−1,4−dimethylcyclodecene and name them, including (e)/(z) and (r)/(s) notation. part 1 out of 4 draw the diastereomer containing a chiral center with s configuration here. window open
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
How do you share someone else’s tweet with your own twitter followers?
Answers: 1
You know the right answer?
Define the class Grid, which is an abstraction of a game board, like a chess board. The Grid class h...
Questions
Questions on the website: 13722362