Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package javaapplication1;
- import javax.swing.JOptionPane;
- /**
- *
- * @author Cody
- */
- public class JavaApplication1 {
- public class BankAccount{
- float balance;
- float interestRate;
- //String compondPeriod;
- public BankAccount() {
- this.balance = 0.00;
- this.interestRate = 0.00;
- //this.compondPeriod="";
- }
- /*
- public float calculateBalance(int compoundPeriod){
- for(int i = compoundPeriod;i>0;i--){
- this.balance *= 1+interestRate;
- }
- }
- */
- }
- public static void main(String[] args){
- BankAccount account1;
- String balance = JOptionPane.showInputDialog(null, "Please enter the amount in your account");
- String interestRate = JOptionPane.showInputDialog(null, "Please the interest rate in %");
- account1.interestRate = Integer.parseInt(interestRate);
- //account1.compoundPeriod = JOptionPane.showInputDialog(null, "Please enter ")
- account1.compoundPeriod ="12";
- JOptionPane.showMessageDialog(null, "If your account had a compound period of " + compoundPeriod);
- sayHelloTo(balance);
- // TODO code application logic here
- }
- public static void sayHelloTo(String nameToGreet){
- JOptionPane.showMessageDialog(null, "Hello, " + nameToGreet + "!");
- }
- }
Add Comment
Please, Sign In to add comment