Advertisement
Guest User

Cannot find symbol error

a guest
Mar 22nd, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.Scanner;
  3.  
  4. public class depositsAndWithdrawlFiles{
  5.     public static void main(String[]args) throws IOException {
  6.        
  7.         SavingsAccount account1 = new SavingsAccount(500);
  8.         account1.setAnnualInterestRate(12);
  9.         double totalInterestEarned = 0;
  10.        
  11.         File depositFile = new File("deposits.txt");
  12.         File withdrawlsFile = new File("withdrawls.txt");
  13.        
  14.         Scanner inputFile = new Scanner(depositFile);
  15.        
  16.         while(inputFile.hasNext() ) {
  17.             account1.deposit(inputFile.nextDouble() );
  18.         }
  19.        
  20.         inputFile.close();
  21.        
  22.         inputFile = new Scanner(withdrawlsFile);
  23.        
  24.         while(inputFile.hasNext() ) {
  25.             account1.withdraw(inputFile.nextDouble() );
  26.         }
  27.        
  28.         inputFile.close();
  29.        
  30.         account1.addMonthlyInterest();
  31.        
  32.         System.out.println("Ending balance: $%,.f\nTotal interest earned: $%,.f", account1.getBalance(), totalInterestEarned);
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement