subject

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?

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:40
Consider the following generator matrix: g= (1 0 0 0 1 0 0 0 1 1 1 1 1 0 1 1 1 0) find all the codewords generated by this generator matrix. determine the number of errors that this code will detect. determine the number of errors that this code will correct. prove that a linear code's minimum weight is equivalent to its minimum distance. that is, where c is a linear code, dist(c) = wh(c)
Answers: 1
question
Computers and Technology, 22.06.2019 14:30
Hi plz 11 ! when planning a table, what step comes first: "define the column headers" or "calculate the number of columns/rows"? a. calculate the number of columns/rows b. define the column headers
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
When is a chart legend used a. all the time b. whenever you are comparing data that is the same c. whenever you are comparing multiple sets of data d. only for hand-drawn charts
Answers: 2
question
Computers and Technology, 24.06.2019 00:00
Afashion designer wants to increase awareness about her brand. which network can she use and why she can use the blank to blank her products online. answers for the first blank: internet, extranet, or intranet answers for the second blank: market, design, and export
Answers: 1
You know the right answer?
There are three person objects, john, mary and jane, sharing a piggy bank of $1000. The Person class...
Questions
question
English, 16.10.2020 22:01
question
Geography, 16.10.2020 22:01
question
Mathematics, 16.10.2020 22:01
Questions on the website: 13722359