a you should choose a proper constructor 2. for this object of the Act a setting an initial value (for example, $500) to Luse the set method instance variable balance of this object b. calling a proper method of class Project BankAccount to display a message about the balance in the account calling a proper method of class Projecte BankAccount to withdraw 5.300 from the d. calling a proper method of class Project BankAccount to display a message about the 3. request the initial balance from user 4 create another object of class Project4_BankAccount named myAct with the initial balance obtained from user in step 3 5. for this object of myAct, repeat step 26 through 2d, except it is to deposit $200 to the bank account in step c un the application Project4_BankAccountDemo_Yourinitial java. Snapshot your compiler window to ully show your output pane and name the image as Project BankAccount YourName.png. • You must make sure your both program files are in the same folder. IS140, TSU Table 1: Members of class Project4_BankAccount Project4, BankAccount -lowBalance: static final double -balance: double -username: String + Project4_BankAccount (usema:String): Project4_BankAccount (usemame: String, balance: double): getBalance (double setBalance (balance: double):void * deposit (amount: double):void withdraw (amount:double):void displayMessage(): od Sample Output Create an object with no initial Set $500 to the balance! balance information for Here is a The current balance in 500.00. withdraw 8300 from account! Here is account balance information for The current balance in 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 ( The current balance in 392.00. Deposit $200 to account! Mere La account balance information for M Created by Li Ma Bank username, initiated when creating the first object of the class Bankusemame and initial balance, entered by user Different useam inted 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 5PE: Using classes, design an online address book to keep track of the names, addresses, phone numbers,...
icon
Related questions
Question

Can you please help me do this JAVA program? Thank you (:

a. you should choose a proper constructor
2. for this object of the Act
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 Project BankAccount to display a message about the
balance in the account
c. calling a proper method of class Project BankAccount to withdraw $300 from the
bank account
d.
calling a proper method of class Project4_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_BankAccount named myAcct with the initial balance
obtained from user in step 3
5. for this object of myAcct, 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.
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 Li 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 L
Please enter the initial balances (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
Bank usemame and initial
balance, entered by user
Different Bank username,
initialized when creating the
second object of the class
Transcribed Image Text:a. you should choose a proper constructor 2. for this object of the Act 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 Project BankAccount to display a message about the balance in the account c. calling a proper method of class Project BankAccount to withdraw $300 from the bank account d. calling a proper method of class Project4_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_BankAccount named myAcct with the initial balance obtained from user in step 3 5. for this object of myAcct, 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. 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 Li 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 L Please enter the initial balances (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 Bank usemame and initial balance, entered by user Different Bank username, initialized when creating the second object of the class
Project 4 - Define & Use Class BankAccount
Due on Sunday, 3/5/2023, by 11:59pm
Lab Objectives
This lab was designed to reinforce programming concepts from Chapter 3 of Java How to Program: 11/e.
In this lab you will practice:
Declaring a class
Using class objects
Problem Description
Write a Java program to define a class called Project4_BankAccount. Then write a Java application
called Project4_BankAccount Demo_YourInitial to use class Project4_BankAccount.
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
o balance: if it is below lowBalance, the bank account has been overdrawn
o 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 lowBalance.
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_BankAccountDemo_YourInitial to use class
Project4_BankAccount by
1. creating an object of class Project4_BankAccount named the Acct with no initial balance
Transcribed Image Text:Project 4 - Define & Use Class BankAccount Due on Sunday, 3/5/2023, by 11:59pm Lab Objectives This lab was designed to reinforce programming concepts from Chapter 3 of Java How to Program: 11/e. In this lab you will practice: Declaring a class Using class objects Problem Description Write a Java program to define a class called Project4_BankAccount. Then write a Java application called Project4_BankAccount Demo_YourInitial to use class Project4_BankAccount. 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 o balance: if it is below lowBalance, the bank account has been overdrawn o 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 lowBalance. 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_BankAccountDemo_YourInitial to use class Project4_BankAccount by 1. creating an object of class Project4_BankAccount named the Acct with no initial balance
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 6 images

Blurred answer
Knowledge Booster
Development strategies
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT