Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Class to be used for questions 1 and 2: public class AccountRecord implements Serializable { private int accountNo; private String fullName; private double balance; //

Class to be used for questions 1 and 2:

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 method setAccountNo // get account number no public int getAccountNo() { return accountNo; } // end method getAccountNo // set full name public void setFullName( String name ) { fullName = name; } // end method setFullName // get full name public String getFullName() { return fullName; } // end method getFullName // set balance public void setBalance( double bal ) { balance = bal; } // end method setBalance // get balance public double getBalance() { return balance; } // end method getBalance } // end class AccountRecord

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

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).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

=+ 4. Why should policymakers think about incentives?

Answered: 1 week ago

Question

=+ 2. What is the opportunity cost of seeing a movie?

Answered: 1 week ago

Question

=+ what roles should government play in them ?

Answered: 1 week ago