Implement read methods for the Bank and BankAccount classes. Write a sample program to read in a file  with bank accounts, read a file for the transactions and perform these transactions on the concerned accounts

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Exercise 1:
Design a class Bank that contains a number of bank accounts. Each account has an account number and a 
current balance. Add an accountNumber field to the BankAccount class. Store the bank accounts in an 
array list. Write a readFile method of the Bank class for reading a file with the format 
accountNumber1, balance1
accountNumber2, balance2

Write a readAndPerformTransactions method of the Bank class for reading a file that describes the 
transactions done by different bank accounts and perform these transactions. For example,
1234456742 withdraw 375
8686349535 deposit 850
1234456742 deposit 150

Implement read methods for the Bank and BankAccount classes. Write a sample program to read in a file 
with bank accounts, read a file for the transactions and perform these transactions on the concerned accounts, 
print the details of the accounts after performing the transactions, and print the account with the highest balance. 

Week 6 456d6986a3e48dea6la2 x
O File | C:/Users/SUPERB/Documents/com.moodle.moodlemobile/sites/eaab9c39cedd5d002107ff18c7ae64ae/filepool/Week%206_456d6986a3e48dea6.
of 1
O D Page view |
A Read aloud V Draw
9 Highlight
O Erase
1
Exercise 1:
Design a class Bank that contains a number of bank accounts. Each account has an account number and a
current balance. Add an accountNumber field to the BankAccount class. Store the bank accounts in an
array list. Write a readFile method of the Bank class for reading a file with the format
accountNumberl, balancel
accountNumber2, balance2
Write a readAndPerformTransactions method of the Bank class for reading a file that describes the
transactions done by different bank accounts and perform these transactions. For example,
1234456742
withdraw
375
8686349535
deposit
deposit
850
1234456742
150
Implement read methods for the Bank and BankAccount classes. Write a sample program to read in a file
with bank accounts, read a file for the transactions and perform these transactions on the concerned accounts,
print the details of the accounts after performing the transactions, and print the account with the highest balance.
Exercise 2:
Write a Java program that allows the user to specify a file name on the command line and prints the number of
characters, words, lines, average number of words per line, and average number of characters per word in that
file. If the user does not specify any file name, then prompt the user for the name.
Exercise 3:
Solve the programming exercise P10.4 on Page 534 on the book.
Write a program that reads a file containing two columns of floating-point
numbers. Prompt the user for the file name. Print the average of each column.
Exercise 4:
Solve the programming exercise P10.8 on Page 535 on the book.
Write a program that replaces each line of a file with its reverse. For example,
if you run
java Reverse HelloPrinter.java
then the contents of HelloPrinter.java are changed to
retnirPolleH ssalc cilbup
Transcribed Image Text:Week 6 456d6986a3e48dea6la2 x O File | C:/Users/SUPERB/Documents/com.moodle.moodlemobile/sites/eaab9c39cedd5d002107ff18c7ae64ae/filepool/Week%206_456d6986a3e48dea6. of 1 O D Page view | A Read aloud V Draw 9 Highlight O Erase 1 Exercise 1: Design a class Bank that contains a number of bank accounts. Each account has an account number and a current balance. Add an accountNumber field to the BankAccount class. Store the bank accounts in an array list. Write a readFile method of the Bank class for reading a file with the format accountNumberl, balancel accountNumber2, balance2 Write a readAndPerformTransactions method of the Bank class for reading a file that describes the transactions done by different bank accounts and perform these transactions. For example, 1234456742 withdraw 375 8686349535 deposit deposit 850 1234456742 150 Implement read methods for the Bank and BankAccount classes. Write a sample program to read in a file with bank accounts, read a file for the transactions and perform these transactions on the concerned accounts, print the details of the accounts after performing the transactions, and print the account with the highest balance. Exercise 2: Write a Java program that allows the user to specify a file name on the command line and prints the number of characters, words, lines, average number of words per line, and average number of characters per word in that file. If the user does not specify any file name, then prompt the user for the name. Exercise 3: Solve the programming exercise P10.4 on Page 534 on the book. Write a program that reads a file containing two columns of floating-point numbers. Prompt the user for the file name. Print the average of each column. Exercise 4: Solve the programming exercise P10.8 on Page 535 on the book. Write a program that replaces each line of a file with its reverse. For example, if you run java Reverse HelloPrinter.java then the contents of HelloPrinter.java are changed to retnirPolleH ssalc cilbup
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY