Question: JAVA PROGRAMMING 1) Make a public class called ReadAccounts. This class will read a file (accountsData.bin) where the data is Byte-based stream. Once you have

JAVA PROGRAMMING

1) Make a public class called ReadAccounts. This class will read a file ("accountsData.bin") where the data is "Byte-based stream". Once you have read the file, print the total sum of the balance sheets and their average (Use the AccountRecord class mentioned below(attachments)).

2) Make a public class called WriteAccounts. This class will write in a file ("accountsData.bin") where the data is "Byte-based stream". The program must ask several accounts, and save the data in a file (Use the class AccountRecord).

public class AccountRecord implements Serializable{

private int accountNo;

private String fullName;

private double balance;

// initialize a record

public AccountRecord(int acctNo, String name, double bal) {

setAccountNo(acctNo);

setFullName(name);

setBalance(bal);

}// end four-argument AccountRecord constructor

// set account number no

public void setAccountNo(int acctNo) {

accountNo = acctNo;

}// end of method setAccountNo

// get account number no

public int getAccountNo() {

return accountNo;

}// end of method getAccountNo

// set full name

public void setFullName(String name) {

fullName = name;

}// end of method setFullName

// get full name

public String getFullName() {

return fullName;

}// end of method getFullName

// set balance

public void setBalance(double bal) {

balance = bal;

}// end of method setBalance

// get balance

public double getBalance() {

return balance;

}// end of method getBalance

}// end class AccountRecord

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!