Question: Can You help me this in java Requirements The features described below must be in your program. - A total of 3 classes: Driver, Complaint,
Can You help me this in java
Requirements
The features described below must be in your program.
A total of classes: Driver, Complaint, StateComplaintException.
StateComplaintException is a subclass of Exception.
It contains a single overloaded constructor which takes in a string. This string is passed to the super class constructor.
Complaint contains private fields:
causeOfAction, plaintiffCitizenship, defendandCitizenship, and originalStateOfFilling, which are all strings.
amountInControversy, which is a double.
id which is an integer.
nextID, which is a static integer initialized at
Complaint contains getters for all the fields except nextID.
Complaint contains an overloaded constructor which accepts strings and double, assigning them as appropriate to the object's fields. It then assigns nextID to id and increments nextID by
The Driver contains two static methods.
processComplaintComplaint c: a static method which returns nothing and accepts a Complaint. If the complaint is a valid federal complaint, the method does nothing. If the complaint is not a valid federal complaint, it throws a StateComplaintException with the appropriate message. The rules defining valid federal complaints are as follows and should be checked in the order they appear:
All complaints whose cause of action are as below are always valid federal complaints ie all other bullet points can be ignored:
"Equal Protection Challenge"
"Title IX Workplace Discrimination"
"Prisoner Civil Rights Claim"
"Fair Labor Standard Act Claim"
If the plaintiff's state of citizenship and the defendant's state of citizenship are the same, throw a StateComplaintException with the message "Lack of Diversity".
If the complaint's Amount in Controversy is less than or equal to $ throw a StateComplaintException with the message "Amount in controversy less than or equal to $
If the defendant's state of citizenship matches the complaint's original state of filing, throw a StateComplaintException with the message No prejudice through diversity".
The main method. It must prompt the user for a file name.
If the file name doesn't exist, print a message that the file could not be
found and terminate the program.
If the file is found, process all complaints in the input file. The input file will
be in the commaseparated standard, meaning each line holds a single
complaint, and all the different pieces of information of the complaint will
be separated by commas without spaces between the pieces of
information and the commas:
causeOfActionamountInControversyplaintiffCitizenshipdefendantCitizenshiporiginalStateOfF illing
Valid federal complaints should be written to "accepted.txt with each
complaint in the following format:
Case ID: ID
Cause of action: causeOfAction
Amount in Controversy: $amountInControversy
Plaintiff's Citizenship: plaintiffCitizenship
Defendant's Citizenship: defendantCitizenship
Originally filled in: originalStateOfFilling
All invalid federal complaints ie: complaints which threw a
StateComplainException should be written to "remanded.txt with each
complaint in the following format:
Case ID: ID
Cause of action: causeOfAction
Amount in Controversy: $amountInControversy
Plaintiff's Citizenship: plaintiffCitizenship
Defendant's Citizenship: defendantCitizenship
Originally filled in: originalStateOfFilling
Reason for remand: Exceptions message
The main method should then print a message stating that the processing
has been completed, where the data has been written to and the total
number of accepted and remanded cases.
Considerations
Remember that you will get partial credit for partial work. Try to deliver as much of the
assignment as you can.
You may add any helper methods you believe are necessary, but you will not get points
for them.
You can assume that the input file will only contain valid entries eg: a complaint will not
be lacking the amount in controversy
While there will only be rubric items checking if you caught file exceptions or
StateComplaintExceptions, it is good practice to anticipate and catch all exceptions
when dealing with user input.
You can find a sample input file on the FYE Website complaintstxt and its associated
outputs acceptedtxt and "remanded.txt
Your program needs to produce the correct output for any valid input file.
Example : User input in red
Federal Court Complaint Processor
Enter file name to process: complaint.txt
No file with name "complaint.txt
Shutting down...
Example : User input in red
Federal Court Complaint Processor
Enter file name to process: complaints.txt
Processing complete. Accepted cases written to accepted.txt and remanded cases written to
remanded.txt
Number of remanded cases:
Number of accepted cases:
Shutting down...
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
