Question: ANSWER ALL PARTS IN JAVA PLEASE Part 1 Part 2 ANSWER ALL PARTS IN JAVA PLEASE Imagine you are writing a Java package for storing

ANSWER ALL PARTS IN JAVA PLEASE

Part 1 ANSWER ALL PARTS IN JAVA PLEASE Part 1Part 2 ANSWER ALLPart 2

PARTS IN JAVA PLEASE Imagine you are writing a Java package forANSWER ALL PARTS IN JAVA PLEASE

Imagine you are writing a Java package for storing DNA and RNA sequences. Recall that a DNA sequence can be thought of as a String over the alphabet {A,C,G,T}, and an RNA sequence can be thought of as a String over the alphabet {A,C,GU}. TASK: Create the following: A new exception called InvalidBioSequence TypeException that extends the Exception class. It must have a no- parameter constructor, which just calls the corresponding superclass constructor A new exception called InvalidSequenceException that extends the Exception class. It must have a no- parameter constructor, which just calls the corresponding superclass constructor A new exception called InvalidDNASequenceException, which extends Invalid SequenceException. It must have a no-parameter constructor, which just calls the no-parameter superclass constructor A new exception called InvalidRNASequenceException, which extends Invalid SequenceException. It must have a no-parameter constructor, which just calls the no-parameter superclass constructor A class called BioSequence, which has the following properties: It should have two private instance variables of type String called seqType and sequence It must have a constructor with a parameter of type String called seqType followed by a parameter of type String called sequence. If seqType is not "DNA" nor "RNA", throw an InvalidBioSequenceTypeException. If seqType is "DNA" and sequence has any characters outside of {A,C,G,T}, throw an InvalidDNASequenceException. If seqType is "RNA" and sequence has any characters outside of (A,C,G,U), throw an InvalidRNASequenceException TASK: Create a new exception called OverdraftException that extends the Exception class. It must have a no- parameter constructor, which just calls the corresponding superclass constructor. Also, write a BankAccount class with the following properties: It should have 1 private instance variable: double balance to store the amount of money in this BankAccount It must have a constructor with one parameter of type double called balance that initializes the instance variable accordingly It must have a public getter method getBalance, which simply returns the current balance It must have a public method called deposit that has one parameter of type double called amount, and it should increase balance by amount It must have a public method called withdraw that has one parameter of type double called amount, and it should decrease balance by amount. If amount was larger than balance, the method should instead just throw an OverdraftException

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!