Description
You can post solutions at the end of the document in the same file unless exclusively requested, no plagiarism or duplication is permitted, comments are not required for programs unless exclusively asked for.
Unformatted Attachment Preview
Purchase answer to see full attachment
Explanation & Answer
I did this.Please review at least some my work because if you'd correct all 6 simultaneously, it may be a tragedy:)
Class Number:
Lab Activity Number: 6
Date:
Instructor’s name:
I. Account Class.
//************************************************************
// Account.java
// A bank account class with methods to deposit to, withdraw from,
// change the name on, and get a String representation
// of the account.
//************************************************************
public class Account
{
private double balance;
private String name;
private long acctNum;
//------------------------------------------------//Constructor -- initializes balance, owner, and account number
//------------------------------------------------public Account(double initBal, String owner, long number)
{
balance = initBal;
name = owner;
acctNum = number;
numAccounts++; // ADDED
}
// ADDED start
static final long MAX_ACCOUNT_NUM = 10000;
// initializes the balance and owner as specified;
// randomly generates the account number.
public Account(double initBal, String owner)
{
balance = initBal;
name = owner;
acctNum = (long)(Math.random()*MAX_ACCOUNT_NUM);
numAccounts++;
}
private static i...