Solved

Help with Java program

Posted on 2011-02-17
3
409 Views
Last Modified: 2012-05-11
Hello everyone,

I am learning how to program in Java, and need some help with a program I am writing. The program is titled BankAccount. It is accessed and receives input from BankAccountUser. I have the entire thing working, except for the interest part. If you could please download my source code and take a look, you will see what I mean. The program does not add the interest like I am asking it too.

I'm probably missing something simple, but I need help finding what it is.

Thank you in advance!

Kody

Here is the file that contains the methods that make it work:

BankAccount.java

Here is the file that contains the main method that accepts user input:

BankAccountUser.java
0
Comment
Question by:Kody-Burg
  • 2
3 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 500 total points
ID: 34922804
In your constructor
  public BankAccount ( double newBalance , double interestRate )
        {
            balance = newBalance;
        }
you don't assign interestRate
0
 
LVL 47

Expert Comment

by:for_yan
ID: 34922817

You need to do something like that:
  public BankAccount ( double newBalance , double interestRate )
        {
            balance = newBalance;
          this.interestRate = interestRate;
        }
0
 
LVL 6

Author Closing Comment

by:Kody-Burg
ID: 34922852
Wow. DUH! I can't believe I missed something that simple. Guess I just needed a second set of eyes to look at it for me.

Thank you! :-)
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now