subject

5.9.1. groupwork programming challenge : bank account

create a class called bank account below that keeps track of the account holder’s name, the account number, and the balance in the account. make sure you use the appropriate data types for these.

write 2 constructors for the class that initialize the instance variables to default values and to given parameters. for the parameters, use the same variable names as your instance variables. use the this keyword to distinguish between the instance variables and the parameter variables.

write a tostring() method for the class. use the this keyword to return the instance variables.

write a withdraw(amount) and deposit(amount) for the class. withdraw should subtract the amount from the balance as long as there is enough money in the account (the balance is larger than the amount). deposit should add the amount to the balance. use the this keyword to refer to the balance.

test your class below with a main method that creates a bank account object and calls its deposit and withdraw methods and prints out the object to test its tostring() method.

(java btw)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
This first part of the film shows the early history of motion pictures. how accurate do you think the portrayal of the early motion picture industry is? why? is historical accuracy important in films and theatre productions? explain. in the scene where don is going to the party (starting at time code 14: 51), we see a street scene as he first rides with cosmo and then with kathy. what aspects did the filmmaker include to make the scene look and feel like don, cosmo, and kathy are riding in a car on a street? think about elements such as scenery, sound, props, lighting, and so on. a "talkie" picture is shown starting around time code 21: 15. how does the audience in the film react to the "talkie"? what influence do audiences have on film and theatre performances? how do film and theatre actors influence audiences? in the musical scene with cosmo (starting at time code 27: 00), how does the actor use props? what is the result? do you think the use of props effectively fulfilled the artistic vision for this musical number? why or why not?
Answers: 1
question
Computers and Technology, 22.06.2019 23:50
List a few alternative options and input and output over the standerd keyboard and monitor. explain their functioning in details.
Answers: 2
question
Computers and Technology, 23.06.2019 15:30
Brian wants to conduct an online search with a certain phrase. he intends to use the words books that belong to the 1800s in his search. how should he use the word that in his search?
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
Hey so i was just trying out some game hacks so i took a paste from online and built it in my visual studio and then suddenly my computer was working or clicking on stuff on its own am i hacked?
Answers: 1
You know the right answer?
5.9.1. groupwork programming challenge : bank account

create a class called bank account...
Questions
question
Mathematics, 11.02.2022 01:10
Questions on the website: 13722362