All pastes #267222 Raw Edit

Miscellany

public java v1 · immutable
·published 2006-12-04 18:30 UTC
rendered paste body
import java.util.Scanner;public class JavaBank{	public static void main(String[] args)	{		int numMonths;     		 // The number of tests		int[] months;     		 // Array for balances		double balance;			 // Initialize balance as a double		double interestRate;	 // Initialize interestRate as a double		double lastInterest = '0';		SavingsAccount savings = new SavingsAccount();		System.out.println("\tJavaAuto\n\tProgrammed by: Marc Pen\n\tAssignment #6");		Scanner keyboard = new Scanner(System.in);		System.out.print("Enter the starting balance:");		balance = keyboard.nextDouble();		//System.out.print("Enter annual interest rate:");		//interestRate = keyboard.nextDouble();		//System.out.print(balance + " " + interestRate);		//lastInterest = keyboard.nextDouble();      // Get the number of test scores.      System.out.print("Enter the starting balance:");      numMonths = keyboard.nextInt();      // Create an array to hold that number of scores.      months = new int[numMonths];      // Get the individual month balance.      for (int index = 0; index < months.length; index++)      {         System.out.print("Enter test score " +                          (index + 1) + ": ");         months[index] = keyboard.nextInt();      }      // Display the balances.      System.out.println();      System.out.println("Withdrawals:");      for (int index = 0; index < months.length; index++)		System.out.print(months[index] + " ");   }	public static void withdraw(double lastBalance)	{		System.out.println(lastBalance + " ");	}}