Suppose in a particular business all documents are given a one- character designation starting with either U,
Question:
Suppose in a particular business all documents are given a one-character designation starting with either U, C, or P, standing for unclassified, confidential, or proprietary. These codes are put in the names of the files, at the very beginning, followed by an underscore. For example, a file might be named U_QuarterOneData.txt or P_Numbers.txt design an exception class called InvalidDocumentCodeException, made to be thrown when the designation for a document is not U, C, or P. Implement this exception in a Driver class (in the same file) that asks the user for the names of files. When the program encounters a file with an invalid designation, it should throw an InvalidDocumentCodeException, catch it, and handle it by printing, "This document has an invalid code." Then, it should continue processing files. The program should end when the user inputs DONE.
Sample Run
Enterfilename:U_JuneData.txt Enterfilename:P_JulyData.txt Enterfilename:C_AugustData.txt Enterfilename:K_SeptemberData.txt Thisdocumenthasaninvalidcode. Enterfilename:C_OctoberData.txt Enterfilename:DONE
Accounting Information Systems basic concepts and current issues
ISBN: 978-0078025334
3rd edition
Authors: Robert Hurt