subject

Write a Patron. java program using Jrasp and Dr. java to test it. The Patron constructor will be used to initialize all attributes of the Patron object. The adjustBalance will update the current balance of the patron. For example if the current balance of a Patron is 2.0 and the amount is 4.5, this method should assign 6.50 to this. balance and return 6.50.The equals method checks whether two patrons have the same id number. If the given object is a Patron, compare this. idNumber with the other patron's idNumber. If the given object is an Integer, compare this. idNumber with the Integer. The toString method should return a String representation of the Patron. If a patron is initialized with the following parameters ("bob", "eee", 2, 5.5), it should return a String exactly as follows: "Name: bob, Email: eee, ID: 2, Balance: $5.50."Code for PatronTest Caseimport junit. framework. TestCase;/*** Tests Patron: currently one test method.** @author* @version**/public class PatronTest extends TestCase { /** A single test for Patron. **/ public void testPatron() { Patron aPatron1 = new Patron("Dee A. B. Weikle", "[email protected]", 2, 1.50); assertEquals("Patron: toString", "Name: Dee A. B. Weikle," + " Email: [email protected], ID: 2, Balance: $1.50.", aPatron1.toString()); Patron aPatron2 = new Patron("Dee A. B. Weikle", "[email protected]", 2, 1.50); assertTrue("Patron: equals", aPatron1.equals(aPatron2)); aPatron1.adjustBalance(2.50); assertEquals("Patron: toString", "Name: Dee A. B. Weikle," + " Email: [email protected], ID: 2, Balance: $4.00.", aPatron1.toString()); }}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:00
What engine component is shown in the above figure?
Answers: 1
question
Computers and Technology, 23.06.2019 22:50
An environmental protection agency study of 12 automobiles revealed a correlation of 0.47 between engine size and emissions. at 0.01 significance level, can we conclude that there is a positive association between the variables? what is the p value? interpret.
Answers: 2
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe what
Answers: 1
question
Computers and Technology, 24.06.2019 09:50
Self contained sequences of actions to be performed are? a. expressions b. algorithms c. functions d. formulas
Answers: 1
You know the right answer?
Write a Patron. java program using Jrasp and Dr. java to test it. The Patron constructor will be use...
Questions
question
Health, 04.12.2020 14:00
question
Biology, 04.12.2020 14:00
question
Mathematics, 04.12.2020 14:00
question
History, 04.12.2020 14:00
Questions on the website: 13722367