subject

Project 15B - BankAccount package: proj15B
class: BankAccount

Create a class called BankAccount. It should have the following properties:
1. Three state variables:

• double balance… This is how much money is currently in the account.
• String name…The name of the person owning the account.
• int accountNumber... the 8 digit account number
2. Constructor should accept three parameters.

1. One should be a double variable that is used to initialize the state variable, balance.
2. The other should be a String that is used to initialize the state variable, name.
2. The account number (8 digit)
3. Methods:

1. deposit()…returns nothing…accepts a double that is the amount of money being
deposited. It is added to the balance to produce a new balance.
2. withdraw()…returns nothing…accepts a double that is the amount of money
being taken out of the account. It is subtracted from the balance to produce a
new balance.
3. checkBalance()... when this method is used it prints the balance of the bank account.
Create a BankAccount. class that has a main( ) method. In that method you should be able to create a bank account with a name and a starting amount. Once it has been created it will then allow you to make a deposit, withdrawl or check the balance.

When either a deposit, withdrawl or check balance is made the program prints out the name of the account, the amount deposited or withdrawn and the total amount in the account.
Example:

Account Name: Jones
Deposit: $14.56
Account Total: $1405.22

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:30, bl88676
1. before plugging in a new device to a computer you should unplug all other devices turn off the computer turn on the computer 2. many of the maintenance tools for a computer can be found in the control panel under administrative tools display personalization
Answers: 1
image
Computers and Technology, 23.06.2019 00:20, kathlynskare06
Ihave been given the number of guns per 100, and the total firearm-related deaths per 100,000. i have to find the actual number of guns per country and actual number of gun-related deaths. if somebody could show me how to do 1 question, i can finish the rest, i am just confused. tia
Answers: 3
image
Computers and Technology, 23.06.2019 02:30, hailey5campbelp7d1c0
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
image
Computers and Technology, 23.06.2019 13:30, mads000
Drag the tiles to the correct boxes to complete the pairs. match the errors with their definitions. #name #value #ref when a formula produces output that is too lengthy to fit in the spreadsheet cell arrowright when you enter an invalid cell reference in a formula arrowright when you type text in cells that accept numeric data arrowright when you type in a cell reference that doesn’t exist arrowright reset next
Answers: 1
You know the right answer?
Project 15B - BankAccount package: proj15B
class: BankAccount

Create a class call...

Questions in other subjects: