Menu

(Solved) : 1 Create Java Class Call Sensitivedb Main Method Using Java S Filewriter Class Create Meth Q26322996 . . .

1) Create a Java class call SensitiveDB with a “main”method.

a) Using Java’s FileWriter class,create a method “writeEntry” which should take the following Stringparameters and in the following order: acct, last_name, first_name,transaction_type (deposit, withdrawal, balance), amount

b) The “writeEntry” method shouldwrite the parameters to a file named “DB.txt” and each field shouldbe separated by a semi-colon. There should only be one record perline.

c ) Using Java’s LineNumberReaderclass, create a method “readEntry” which takes NO parameters. Itwill read the “DB.txt” file and output all of the records to theconsole (Console output window in Eclipse or the command line).

d) Using Java’s LineNumberReaderclass, create an overloaded method “readEntry” which takes one (1)parameter, which is the number of the line in the DB.txt to outputto to the console. Essentially, it will print out the record andthe line number you specify.

e) Modify the main function toinstantiate an object of SensitiveDB and does the following todemonstrate that your methods work:

Write 5 banking records to the DB.txt(make up the values, select a transaction_type)

Read all records and print themout.

Read and print out the 4th recordonly.

Expert Answer


Answer to 1 Create Java Class Call Sensitivedb Main Method Using Java S Filewriter Class Create Meth Q26322996 . . .

OR