Question
Specification Include a private variable of type int to represent the account balance. Provide a constructor that has a parameter for initial balance and uses
Specification
Include a private variable of type int to represent the account balance.
Provide a constructor that has a parameter for initial balance and uses it to initialize the account balance.
Provide 3 member functions:
credit - adds an amount passed as an argument to the current balance.
debit - withdraws an amount passed as an argument from the current balance.
getBalance - returns the balance amount.
Create a program (AccountTest.java) that creates two Account objects and validate the methods of the class Account. (Call the methods passing the appropriate values to make sure they produce the expected results.)
Attach your Account.java and AccountTest.java files and submit.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started