Computers and Technology
Computers and Technology, 18.06.2020 18:57, ajahbraun

There are three person objects, john, mary and jane, sharing a piggy bank of $1000. The Person class contains a double field for the piggy bank. Implement a Java program to instantiate the three objects as follows: Person john = new Person( ); Person mary = new Person( );
Person jane = new Person( );
This Person class also has two methods: one is to withdraw money and the other is to check balance of the piggy bank. Balance checking will return a double primitive value. Provide another class MyProg to start the program execution. In the main method, you should model the following behavior by using the methods. First, John took $75 out of the piggy bank and then viewed the balance. Mary later took away $150. John again withdrew another $120. Finally, Jane checked the balance of the piggy bank. Your program should print out the result for each balance checking. (2.5 pts) Show the UML class diagram for the Person class. (.5 pt) Hint: piggy bank should be declared as a local, an instance or a class variable?

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:30, 710jonathan
The following is an excerpt from a slide presentation. today we will inverse operations solving equations using inverse operations solving inequalities using inverse operations from which part of the presentation does the slide most likely come from? a. introduction b. outline c. body d. conclusion
Answers: 1
image
Computers and Technology, 24.06.2019 00:30, louie8656
Match the sentence fragment in the first column with the appropriate ending in the second column. a little per favore?
Answers: 1
image
Computers and Technology, 24.06.2019 01:00, kayranicole1
What shows the web address of the page that is currently displayed in the workspace? status window toolbar location bar internet box
Answers: 1
image
Computers and Technology, 24.06.2019 14:00, ameliaxbowen7
Which computer tools allow you to communicate with coworkers, family, and friends
Answers: 1
Do you know the correct answer?
There are three person objects, john, mary and jane, sharing a piggy bank of $1000. The Person class...

Questions in other subjects:

Konu
Mathematics, 24.09.2019 00:00
Konu
Social Studies, 24.09.2019 00:00