Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

You need to prepare a java program to create a bank account

Program: Write a client java program that will use a pre-implemented class BankAccount.java. BankAccount class provides template to create BankAccount objects that represent real world bank accounts. Each bank account object stores it's own balance. The class provides various operations (methods) that can be performed (called) on BankAccount objects including checking balance, deposit and withdraw operations.

Note: You don't need to have the knowledge of the code in the BankAccount class in order to use it in your client program. You should use this pre-implemented class using its API. It must compile with no errors and follow the directions.

For this program you will do the subsequent:

Part 1: Create a new Class named BankAccountTest which will be your client program by right clicking the Project folder and select New à Java class.

Part 2: Create a BankAccount object using the default constructor. Name the object reference as accont1.

Part 3: Print the current balance on the terminal window by calling appropriate method

Part 4: Deposit 1000 dollars into account1 by calling appropriate method

Part 5: Print the current balance on the terminal window by calling appropriate method

Part 6: Withdraw 250 dollars from account1 by calling appropriate method

Part 7: Print the current balance of account1 on the terminal window by calling appropriate method

Part 8: Create another BankAccount object using the other constructor with initial balance as 500. Name the object reference as account2.

Part 9: Print the current balance of the account2 on the terminal window by calling appropriate method.

Part 10: Withdraw 550 dollars from account2

Part 11: Assign account 1 to account 2 ( account2 = account1; )

Part 12: Deposit 50 dollars into account1.

Part 13: Print the current balance of both account1 and account2 on the output window.

Java, Programming

  • Category:- Java
  • Reference No.:- M91238869

Have any Question?


Related Questions in Java

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Answer the following question whats the difference public

Answer the following Question : What's the difference public inheritance and private inheritance? What can derived classes inherit from base classes? What cannot be inherited from base classes?

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As