Ok i have gotten stuck on this program and I need help
This program is supposed to calculate the balance of a
checking account after the user has entered
the type of action (withdrawl, deposit)
they would like to do.
My output should be a report that prints the beginning balance, the action (deposit or withdrawl), the amount and the ending balance.
Thank You Guys In Advance.
public class CheckingAcct
{
public static void main (String [] args)
{
double balance;
double amount;
char accttype;
System.out.print("Enter checking account balance: ");
balance = Input.readDouble ();
balance=0;
System.out.print("Enter account type D=Deposit, W=Withdrawl or B=Balance to end");
accttype = Input.readChar ();
if (accttype.equalsIgnoreCase("d"))
{
System.out.print("Enter deposit amount: ");
amount = Input.readDouble ();
balance = balance + amount;
}
else if (accttype.equalsIgnoreCase("w"))
{
System.out.print("Enter withdrawl amount: ");
amount = Input.readDouble ();
balance = balance + amount;
System.out.println(balance + accttype + amount + balance);
}
else
{
System.out.print(+balance + accttype + amount + balance);
}
} //end main
} // end class CheckingAcct