Computers and Technology

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()); }}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 13:00, alexacarillo
In excel - calculate the actual increase/decrease from first quarter to the second quarter then subtract subtract first quarter value from second quarter total then divide result by first quarter value
Answers: 1
image
Computers and Technology, 23.06.2019 16:30, vitothebest1
You have read about the beginnings of the internet and how it was created. what was the internet originally created to do? (select all that apply) share research. play games. communicate. share documents. sell toys
Answers: 1
image
Computers and Technology, 24.06.2019 13:30, nina288
What process should be followed while giving a reference? sam has given a reference of his previous manager in his resume. sam should him in advance that the potential employers will him.
Answers: 1
image
Computers and Technology, 24.06.2019 15:30, jhony70
What type of forensic evidence was recovered during the bomb set off at the new mexico facility on the video that was similar to the evidence obtained at the boston bombings and how did the evidence allow the researchers to connect other pieces of evidence to the same bomb?
Answers: 2
Do you know the correct answer?
Write a Patron. java program using Jrasp and Dr. java to test it. The Patron constructor will be use...

Questions in other subjects:

Konu
Mathematics, 11.02.2021 07:00
Konu
Social Studies, 11.02.2021 07:00
Konu
Mathematics, 11.02.2021 07:00