Taking a java class, and have a online friend who has been tutoring me, who normally answers my questions... But isnt online now... So thought Id give this forum a try for some help maybe... I have no idea what I am doing wrong here...
/** * Lesson 3 * * @author * @version */ //Create a class called BankAccount public class BankAccount { // The class should have the following fields: private int accountNo; private float balance; private String firstName, lastName; // The class should have ONE constructor with two String parameters: first and last public BankAccount(String first, String last){ balance = 100; accountNo = 12345; firstName = first; lastName = last; } // Create a mutator method called deposit... public void deposit(int depositAmount) { if(depositAmount < 0) { System.out.println("Invalid deposit amount"); } else { balance = balance + depositAmount; } // Create a mutator method called withdraw... public void withdraw(int withdrawAmount) { if(withdrawAmount < 0) { System.out.println("Invalid deposit amount"); } else if (withdrawAmount > balance) { System.out.println("Insufficient funds to complete withdraw request"); } else { balance = balance - withdrawAmount; } // Create a mutator method called changeFirst... public void changeFirst(String first) { firstName = first; System.out.println("First name has been changed to: " + firstName); } // Create a mutator method called changeLast... public void changeLast(String last) { lastName = last; System.out.println("Last name has been changed to: " + lastName); } // Create the accessor method showBal... public void showBal() { System.out.println(balance); } // Create the accessor method accInfo... public void accInto() { System.out.println("Account No: " + accountNo); System.out.println("Account Owner: " + firstName + " " + lastName); System.out.println("Account Balance: " + balance); }