All pastes #403181 Raw Edit

Someone

public java v1 · immutable
·published 2007-03-20 05:49 UTC
rendered paste body
import java.util.*;public class Teller{	public static void main(String [] args)	{			Scanner bbq = new Scanner(System.in);		BankAccount account = new BankAccount();		//attributes			int transNumber = 0;		String transType = null;		boolean go = false;		int j = 0;		System.out.println("Welcome to the Sopprano Bank");				//take number of transactions		do		{			System.out.print("Enter the number of transactions to be performed: ");			try			{				transNumber = bbq.nextInt();			}//end try			catch(Exception e)			{				System.out.println("Error: number of transactions must be an integer value. Exiting...");				System.exit(1);			}//end catch			if(transNumber >= 0)			{				go = false;			}//end if					}//end of do		while(go == true);//end number of transactions		for(j = 0; j < (transNumber * 2); j++)		{			boolean transaction = false;			if(j == (transNumber * 2))			{				transaction = true;			}//end if			do			{				System.out.print("Enter d for deposit or w for withdrawal: ");						transType = bbq.nextLine();				// 				char type = transType.charAt(0);// 				char w = 'w';// 				char d = 'd';								if(transType.startsWith("w"))				{					System.out.print("Enter the amount to withdraw: ");					double withdrawal = bbq.nextDouble();										boolean wd = account.withdrawal(withdrawal);				}//end if				if(transType.startsWith("d"))				{					System.out.print("Enter the amount to deposit: ");					double deposit = bbq.nextDouble();										boolean dp = account.deposit(deposit);				}//end if			}//end do			while(transaction == true);		}//end for		}//end of Main}