Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Class to be used in questions 1 and 2: public classAccountRecord { private intaccountNo; privateString fullName;private doublebalance; // initialize a record publicAccountRecord(intacctNo, String name,doublebal) {

Class to be used in questions 1 and 2:

public classAccountRecord { private intaccountNo; privateString fullName;private doublebalance;

// initialize a record

publicAccountRecord(intacctNo, String name,doublebal) { setAccountNo( acctNo ); setFullName( name ); setBalance( bal );

}// end four-argument AccountRecord constructor

// set account number no

public voidsetAccountNo(intacctNo ) { accountNo = acctNo;

}// end method setAccountNo

// get account number nopublic intgetAccountNo() {returnaccountNo;

}// end method getAccountNo

// set full name

public voidsetFullName( String name ) { fullName = name;

}// end method setFullName

// get full namepublicString getFullName() {returnfullName;

}// end method getFullName

// set balance

public voidsetBalance(doublebal ) { balance = bal;

}// end method setBalance

// get balancepublic doublegetBalance() {returnbalance;

}// end method getBalance

}// end class AccountRecord

1. Make a public class called ReadAccounts. This class will read a file ("accountsData.txt") where the data is "Text-based". Once the file has been read, you must print the total sum of the balances. The data must be read in an array. (Use the AccountRecord class mentioned above).

2. Make a public class called WriteAccounts. This class will write to a file ("accountsData.txt") where the data is "Text-based". The program should ask several accounts, and save the data in an array, until it indicates that it is the end, then save each record or array to a file.(Use the AccountRecord class).

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

What is meant by the term 'byte'?

Answered: 1 week ago

Question

Explain the pages in white the expert taxes

Answered: 1 week ago