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, 22.06.2019 21:30
Write a function named printfloatrepresentation(float number) that will print the floating point representation of a number using the format given below. (sign bit) exponent in binary (assumed bit).significandfor example if the number passed an argument is 71 yourprogram should print (0) 10000101 (1).00011100000000000000000similarly if the number passed to the function as argument is -71 the program should print (1) 10000101 (1).00011100000000000000000
Answers: 3
question
Computers and Technology, 24.06.2019 03:00
Using a conditional expression, write a statement that increments numusers if updatedirection is 1, otherwise decrements numusers. ex: if numusers is 8 and updatedirection is 1, numusers becomes 9; if updatedirection is 0, numusers becomes 7.
Answers: 1
question
Computers and Technology, 24.06.2019 14:30
Two students are discussing the flow of electricity. student a says that voltage is a measure of the amount of electron flow in a circuit. student b says that power is the product of voltage and current. which of the following statements is correct? a. only student a is correct b. only student b is correct c. both of the two students are correct d. neither of the two students is correct
Answers: 1
question
Computers and Technology, 25.06.2019 17:00
Nasa’s long term goal is for travel in space to be as as travel across the atlantic. however, we are away from that.
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
question
History, 19.05.2021 21:00
question
Mathematics, 19.05.2021 21:00
question
Law, 19.05.2021 21:00