Question: any help in c++(98)? Lab 7.3.1 Exceptions: file checks Objectives Familiarize the student with: situations when exceptions are thrown; handling file-related exceptions. Scenario Write a

any help in c++(98)?any help in c++(98)? Lab 7.3.1 Exceptions: file checks Objectives Familiarize the

Lab 7.3.1 Exceptions: file checks Objectives Familiarize the student with: situations when exceptions are thrown; handling file-related exceptions. Scenario Write a class that holds a (2x2) matrix, and add two methods to work with files: one method to load the matrix from a file (in any format) and one method to save the matrix to a file (in the same format). Add code to handle exceptional situations (file not found and no rights to file), print a message and re-throw an exception. Add a try-catch block in the proper places. Simulate both situations handled (try to load a nonexistent file, and try to save a file in a path where you have no proper rights). Example input Simulate both situations handled Example output File not found at: path No rights to write to file: path

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!