0 1 1 0 1 0 1 1 + 0 0 1 1 0 1 0 0 ------------------ <---- your answer __________________
//***************************************************** // Account.java // // A class representing a bank account; allows deposits, // withdrawals, balance inquiries, etc. //***************************************************** public class Account { private double balance; private String name; private long acctNum; //--------------------------------------------------- // Constructor -- initializes instance data //--------------------------------------------------- public Account(double initBal, String owner, long number) { balance = initBal; name = owner; acctNum = number; } //--------------------------------------------------- // Simple withdrawal -- deducts amount from balance //--------------------------------------------------- public void withdraw(double amount) { balance -= amount; } //--------------------------------------------------- // Simple deposit -- adds amount to balance. //--------------------------------------------------- public void deposit(double amount) { balance += amount; } //--------------------------------------------------- // Returns balance. //--------------------------------------------------- public double getBalance() { return balance; } //--------------------------------------------------- // Prints name, account number, and balance //--------------------------------------------------- public void printSummary() { //print name _____________________________ //print acct number _____________________________ //print balance _____________________________ } //--------------------------- // Deducts $10 service fee //--------------------------- public void chargeFee() { ____________________________________________________ } //--------------------------------------------------- // Changes the name on the account to newName. //--------------------------------------------------- public void changeName(String newName) { ___________________________________________________ } }
//***************************************************** // ManageAccounts.java // // A program that uses the Account class to create and // manipulate bank accounts for Sally and Joe. //***************************************************** public class ManageAccounts { public static void main(String[] args) { Account account1, account2; //create account1 for Sally for $1000 account1 = new Account(1000, "Sally", 12345); //create account2 for Joe with $500 ______________________________________________ //deposit $100 to Joe's account ______________________________________________ //withdraw $50 from Sally's account ______________________________________________ //charge fees to both accounts ______________________________________________ ______________________________________________ //change name on Joe's account to Joseph ______________________________________________ //print summary for both accounts ______________________________________________ ______________________________________________ } }