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 3 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 7 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 1.
- Complaint contains getters for all the fields except nextID.
- Complaint contains an overloaded constructor which accepts 4 strings and 1 double, assigning them as appropriate to the object's fields. It then assigns nextID to id and increments nextID by 1.
- The Driver contains two static methods.
- processComplaint(Complaint 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 (i.e. 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 \(\$ 75000\), throw a StateComplaintException with the message "Amount in controversy less than or equal to \(\$ 75000\)".
- 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 comma-separated 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):
[causeOfAction],[amountInControversy],[plaintiffCitizenship],[defendantCitizenship],[originalStateOfF 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 (i.e.: 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: [Exception's 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 (e.g.: 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 ("complaints.txt") and its associated
outputs ("accepted.txt" and "remanded.txt").
Your program needs to produce the correct output for any valid input file.
Example 1: [User input in red]
[Federal Court Complaint Processor]
Enter file name to process: complaint.txt
No file with name "complaint.txt"
Shutting down...
Example 2: [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: 83
Number of accepted cases: 117
Shutting down...
Can You help me this in java Requirements The

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 Programming Questions!