Question: 28. a Write the specification for an ADT SquareMatrix. (A square matrix can be represented by a two-dimensional array with N rows and N columns.)

 28. a Write the specification for an ADT SquareMatrix. (A squarematrix can be represented by a two-dimensional array with N rows and

28. a Write the specification for an ADT SquareMatrix. (A square matrix can be represented by a two-dimensional array with N rows and N columns.) You may assume a maximum size of 50 rows and columns. Include the following operations: MakeEmpty(n), which sets the first n rows and columns to zero Storevalue(,1, value), which stores a value into the , 11 position Add, which adds two matrices together Subtract, which aubtracta one matrix rom another Copy, which copies one matrix into another b. Convert your specification to a C++ class declaration C. Implement the member functions d. Write a test plan for your class. 29. DateType keeps only the integer representation of the month, day, and year. When a month is wanted in string form, the string is calculated. An alternate approach would be to add a string field to the date and calculate and store the string representation in the Initia112e function. Which methods would have to be changed? Would this change make the use of an if statement to find the appropriate string more or less attractive? Write the code for this if statement 30 What changes would be necessary if th number of days in the month were carried as a data feld in cless Basetpe rather than being looked up when necessary? Would this change make the use of a switch statement to find the number of days in the month more attractive? Write the code for this awitch statement. 31 Compare and contrast the implementation of class DateType used in the Case Study and the solution proposed in Exercises 29 and 30. These two approaches represent the classic trade-off between space and algorithm complexity. Please comment

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!