Computers and Technology

P1 – a two-dimensional grid class (40 points) 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 [8pts]. include a no-argument constructor that initializes all the elements of the array to zero [4pts]. 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 [8pts]. 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 [8ts]. 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

answer
Answers: 3

Similar questions

Do you know the correct answer?
P1 – a two-dimensional grid class (40 points) define the class grid, which is an abstraction of a ga...

Questions in other subjects:

Konu
Mathematics, 28.01.2020 06:31