Login|Contact Us
Question and Answer

Programming

Ask a Programming Question, Get an Answer ASAP!

  • Ask A Question
  • Browse Answers
  • Meet The Experts
  • How JustAnswer Works

Write a Java program to simulate a bank account. The bank

 
Todd's Avatar
  • Answered by:Todd
  • Computer Software Engineer
  • Positive Feedback: 100.0 %
  • Accepted Answers: 413
Verified Expert
in Programming

Recent Feedback

Positive
This is just the program I was looking for.
Positive
Awesome! And very patient with my lack of technical knowledge!
Positive
wonderful, excellent communicator, clean code. hope i get this guy next time!
Positive
well done
Positive
Amazing! thanks again!
Positive
Really hung in there with me! Very helpful.
Positive
Thanks for the help and confirmation.
Positive
Verygood. Thank you for the help
Positive
If I wasnt so poor I'd give you a HUGE tip. This is by far the best help I have...
Positive
Helped me see the big picture as far as website building goes. Thank you!

Customer Question

Write a Java program to simulate a bank account. The bank account class should have at least following three operations: deposit, withdraw, and display (balance as well as history of transactions). Assume overdraft is not allowed and the maximum number of transactions is 10. All monetary values used here are floating point type.

1. In the bankAccount class, you should have one variable called totalBalance to balance of an account, a static variable called totalAccounts to track how many accounts have been created, and an array called transactionHistry that recorded the history of transactions associated with that account;

2. Write a constructor using key word this when you initialize the variable totalBalance with the initial value passed as the argument to the constructor. The static variable totalAcounts should be updated within the constructor as well;

3. Implement the deposit and withdraw methods by updating the variable totalBalance and the array transactionHistry;

4. Implement the display methods so that the information like follows will be printed out on the screen:

totalAccounts: 1;
Information about current bank account:
totalBalance: $134.45
tansactionHistry:
deposit: $100.00;
deposite:$55.55;
withdraw: $-15.00
withdraw: $-6.10

5. Use Object-Oriented Programming technique to write a test program, which should run each operation at least once.

Critical thinking
In order to make your program robust, you need to think different scenarios such as:

1. How to enforce the overdraft protection?

2. What if the use input a negative number other than a positive number as the input to your methods?

3. What if a user tries to do transactions when they reach the maximum already?

4. Where should we initialize the static variable totalAccounts?

 

Optional Information:
Computer OS: Windows 7
Browser: Firefox
Programming Language: Java

Submitted: 1226 days and 8 hours ago.
Category: Programming
Value: $22
Status: CLOSED
Picture
Expert:  Todd replied 1226 days and 8 hours ago.

I will have this ready within the hour for you.

Customer replied 1226 days and 8 hours ago.

Cool!

Picture
Expert:  Todd replied 1226 days and 7 hours ago.

Find the files at http://wikisend.com/download/964812/BankAccount.zip

Customer replied 1226 days and 7 hours ago.

Reviewing now...will get right back with you for questions.

Customer replied 1226 days and 6 hours ago.

Hey Todd,

I'm trying to run the program in "eclipse" and I'm getting the following error.

Launch error - selection does not contain a main type.

I'm not a professional java developer as i'm taking a course, so I need a little help.

Please advise.
Customer

Picture
Expert:  Todd replied 1226 days and 6 hours ago.

Are you running the BankAccountDriver class? It is the class that needs to be launched as it contains the main method, i.e. the method that is the entry point to your application. Also, ensure that both Java files are in the project.

Customer replied 1226 days and 6 hours ago.

No,

I wasn't runnign the BankAccountDriver class.

This is an entry level Java programming class so I need the main method to be inserted into (1) file.

I'm sure you are offering professional next level programming, but can we get it all 1 .java file?

Accepted Answer

Picture
Expert:  Todd replied 1226 days and 6 hours ago.

Find the single BankAccount.java with everything in the same class at http://wikisend.com/download/438776/BankAccount.javaTodd A.40147.8684416319

Expert TypeComputer Software Engineer
Category: Programming
Pos. Feedback: 100.0 %
Accepts: 413
Answered: 11/30/2009

Experience: PHP, Ruby, Python, C#, C, C++, Java, CSS, HTML, JavaScript.

Ask this Expert a Question >
Customer replied 1226 days and 6 hours ago.

Thanks Todd.

I'm going to play around with it, but you have given me a great base to work from.

 
Tweet

4 Programmers are Online Right Now

Ask Your Question Now
Programming Questions Date Submitted
C ProgrammingDecode LabYour assignment is to write a C 4/9/2013
Reference the following instructions to assist you when completing 4/8/2013
First you will present the pseudo code with all the modules 4/8/2013
NA-112 4/8/2013
The first programming project involves completing a program 4/8/2013
RA-201 4/7/2013
This is my final exam for my c programming class. It is due 4/7/2013
Program Description Your program will display (see the sample 4/6/2013
RA-211 4/3/2013
ra-614 4/2/2013
RSS
Next 10 >
Ask A Programmer
Type Your Programming Question Here...
characters left:

Top Programming Experts

See More Programmers

In The News

Nbc
Washington Post
New York Times
Cnn
Learn More

How It Works

  • Ask an Expert
  • Get a Professional Answer
  • Ask Followup Questions
  • 100% Satisfaction Guarantee
Learn More
close
Find Expert answers related to your question.
Sign up using email
We will never post anything without your permission.
Already have an account? Sign in

Ask a Programmer

Get a Professional Answer. 100% Satisfaction Guaranteed.
209 Programmers are Online Now
Type Your Programming Question Here...
characters left:
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.
Truste
Contact Us | Terms of Service | Privacy & Security | About Us
© 2003-2013 JustAnswer LLC