Run the application Projec14_BankAccountDemo_YourInitialjava. Snapshot your compiler window to fully show your output pane and name the image as Project4 BankAccount YourName.png. • You must make sure your both program files are in the same folder. CS140, TSU Table 1: Members of class Project4 BankAccount Project BankAccount -lowBalance: static final double -balance: double -username: String + Project4_BankAccount (usemame: String): + Project4_BankAccount (usemame: String, balance:double): +getBalance(): double + setBalance (balance: double):void + deposit (amount:double):void +withdraw lamount : double):void +displayMessage():void Sample Output Create an object with no initial balance! Set $500 to the balance! Here is account balance information for La Ma The current balance is 500.00. Withdraw $300 from account! Here is account balance information for Li Ma The current balance is 200.00. Please enter the user name Ma. La Please enter the initial balance: 392 Create an object with an initial balance! Here is account balance information for Ma Lib The current balance is 392.00. Deposit $200 to account! Here is account balance information for Ma La The current balance in 592.00. Created by Li Ma Bank username, initialized when creating the first object of the class Bankusemame and initial balance, entered by user Different Bank username, initialized when creating the second object of the class

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question
100%

Hello, I really hope you're having a great day. Can you please help me do this Java program, please remember to separate the Java application and the class definition. Thank you!

Step 3:
Run the application Project4_BankAccountDemo_YourInitial.java. Snapshot your compiler window to
fully show your output pane and name the image as Project4_BankAccount_YourName.png.
• You must make sure your both program files are in the same folder.
CS140, TSU
Table 1: Members of class Project4 BankAccount
Project4 BankAccount
- lowBalance: static final double
-balance: double
-username: String
+ Project4_BankAccount (usemame: String):
+ Project4_BankAccount (usemame: String, balance:double):
+getBalance():
double
+ setBalance (balance: double):void
+ deposit (amount : double):void
+ withdraw (amount : double):void
+ displayMessage():void
Sample Output
Create an object with no initial balance!
Set $500 to the balance!
Here is account balance information for (La Ma
The current balance is 500.00.
Withdraw $300 from account!
Here is account balance information for Li Ma
The current balance is 200.00.
Please enter the user name: (Ma La
Please enter the initial balance: (392)
Create an object with an initial balance!
Here is account balance information for Ma Li
The current balance is 392.00.
Deposit $200 to account!
Here is account balance information for Ma Li
The current balance in 592.00.
Created by Li Ma
Bank username, initialized
when creating the first
object of the class
Bankusemame and initial
balance, entered by user
Different Bank username,
initialized when creating the
second object of the class
Transcribed Image Text:Step 3: Run the application Project4_BankAccountDemo_YourInitial.java. Snapshot your compiler window to fully show your output pane and name the image as Project4_BankAccount_YourName.png. • You must make sure your both program files are in the same folder. CS140, TSU Table 1: Members of class Project4 BankAccount Project4 BankAccount - lowBalance: static final double -balance: double -username: String + Project4_BankAccount (usemame: String): + Project4_BankAccount (usemame: String, balance:double): +getBalance(): double + setBalance (balance: double):void + deposit (amount : double):void + withdraw (amount : double):void + displayMessage():void Sample Output Create an object with no initial balance! Set $500 to the balance! Here is account balance information for (La Ma The current balance is 500.00. Withdraw $300 from account! Here is account balance information for Li Ma The current balance is 200.00. Please enter the user name: (Ma La Please enter the initial balance: (392) Create an object with an initial balance! Here is account balance information for Ma Li The current balance is 392.00. Deposit $200 to account! Here is account balance information for Ma Li The current balance in 592.00. Created by Li Ma Bank username, initialized when creating the first object of the class Bankusemame and initial balance, entered by user Different Bank username, initialized when creating the second object of the class
Programming Steps
Step 1:
Write a Java program to define a class called Project4_BankAccount. Let's assume that
• the constant lowBalance is used as a threshold to check if the bank account has been
overdrawn
o set it to 100 (dollars)
• the instance variables of this class are
balance: if it is below lowBalance, the bank account has been overdrawn
ⒸuserName
• the get methods are to get the current value of the instance variables
•
the set methods are to set a new value to the instance variables
•
•
the operations to change the balance are deposit and withdraw (to set a different balance)
the method displayMessage() will display the current balance and will also display the urgent
message of overdrawn if the current balance is below low Balance.
The members of the class Project4 BankAccount are listed in Table 1 on the following page. The sign
is followed by a private member, is followed by a public member.
Step 2:
Write a Java application called Project4_BankAccount Demo_Yourinitial to use class
Project4_BankAccount by
1. creating an object of class Project4_BankAccount named the Acct with no initial balance
a. you should choose a proper constructor
2. for this object of the Acct
a. setting an initial value (for example, $500) to the instance variable balance of this object
i. use the set method
b. calling a proper method of class Project4 BankAccount to display a message about the
balance in the account
c. calling a proper method of class Project4 BankAccount to withdraw $300 from the
bank account
d. calling a proper method of class Project BankAccount to display a message about the
balance in the account again
3.
request the initial balance from user
4. create another object of class Project4_Bank Account named myAcct with the initial balance
obtained from user in step 3
5.
for this object of my Acct, repeat step 2b through 2d, except it is to deposit $200 to the bank
account in step 2c
Step 3:
Run the application Project4_BankAccountDemo_YourInitial.java. Snapshot your compiler window to
fully show your output pane and name the image as Project4 BankAccount YourName.png.
• You must make sure your both program files are in the same folder.
Transcribed Image Text:Programming Steps Step 1: Write a Java program to define a class called Project4_BankAccount. Let's assume that • the constant lowBalance is used as a threshold to check if the bank account has been overdrawn o set it to 100 (dollars) • the instance variables of this class are balance: if it is below lowBalance, the bank account has been overdrawn ⒸuserName • the get methods are to get the current value of the instance variables • the set methods are to set a new value to the instance variables • • the operations to change the balance are deposit and withdraw (to set a different balance) the method displayMessage() will display the current balance and will also display the urgent message of overdrawn if the current balance is below low Balance. The members of the class Project4 BankAccount are listed in Table 1 on the following page. The sign is followed by a private member, is followed by a public member. Step 2: Write a Java application called Project4_BankAccount Demo_Yourinitial to use class Project4_BankAccount by 1. creating an object of class Project4_BankAccount named the Acct with no initial balance a. you should choose a proper constructor 2. for this object of the Acct a. setting an initial value (for example, $500) to the instance variable balance of this object i. use the set method b. calling a proper method of class Project4 BankAccount to display a message about the balance in the account c. calling a proper method of class Project4 BankAccount to withdraw $300 from the bank account d. calling a proper method of class Project BankAccount to display a message about the balance in the account again 3. request the initial balance from user 4. create another object of class Project4_Bank Account named myAcct with the initial balance obtained from user in step 3 5. for this object of my Acct, repeat step 2b through 2d, except it is to deposit $200 to the bank account in step 2c Step 3: Run the application Project4_BankAccountDemo_YourInitial.java. Snapshot your compiler window to fully show your output pane and name the image as Project4 BankAccount YourName.png. • You must make sure your both program files are in the same folder.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Running Time of Application
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage