Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ASSIGNMENT 3 - Class Concept Review The purpose of this assignment is to learn how to read and write to text files and other important

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

ASSIGNMENT 3 - Class Concept Review The purpose of this assignment is to learn how to read and write to text files and other important object oriented concept. Create a project called Assignment 3. You will then write three classes: Assignment3.java - A driver class that contains only a main method which should: Create a new CustomerList object Prompt the user to enter a file name Call the getCustomerList() method with the file name that the user entered While (true) { Prompt user to enter command; if (command is "a") { Prompt user for customer Number firstName lastName balance; Create a customerRecord and store it in the database: 0 16 / 4.35 Assignment3.java - A driver class that contains only a main method which should: Create a new CustomerList object Prompt the user to enter a file name Call the getCustomerListo method with the file name that the user entered While (true) { Prompt user to enter command; if (command is "a") { Prompt user for customerNumber firstName lastName balance; Create a customerRecord and store it in the database; } else if (command is "f") { Prompt the use enter a number and then displays the corresponding record on the screen; } else if (command is "q") { Prompt the user to enter a file name to save the latest update; Save the information in the database to the file specified by the user; Terminate program, } else { Display error message: D 3.35 14:35 + customerList.java - This class contains an array of customerRecord objects. It should have the following data attributes and methods: private int count-number of customers in the array private customerRecord[ data - array of customerRecord objects public customerListo - constructor that should initialize memory for data array and count value public void getCustomerList(String fileName - reads a file call fileName which is a text file containing lines (records) of customer data. This method fills the data array with the records from the file. The file will not have more than 100 records and will have the following format (where customer Number is an integer, firstName and lastName are Strings, and balance is a float: customer Number firstName lastName balance public customer Record getCustomer(int customerNumber) - returns the object corresponding to the customer with customer number customer Number. If the customer number is not in the array, return null. public void enterCustomerRecord(customerRecord new record) - store the customer record into data array public void saveCustermerList(String filename) - save the information stored in the data array to the file called filename 0:22 14:35 4 UWA customerRecord.java - a class that contains the following data attributes and methods: private int customer Number - a unique number assigned to each customer private String firstName - the customer's first name private String lastName - the customer's last name private float balance - the customer's balance get/set Methods for each data attribute public String toString() - Special method to be used when printing a customerRecord object Please provide enough comments for full credits (otherwise you will lose 30% credits) 3:02 14:35 scan.close() : WINNINGUNNNN WWWWWWWWWW Database.txt 11111 Sarah Smith 45.89 22222 Sue Johnson 7765.98 33333 Billy Hunts 374.99 4296 Sam Tubb 2500.0 VAUVA 1:1914:35

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

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions

Question

How can an entrepreneur launching a new business forecast sales?

Answered: 1 week ago

Question

What can a new venture do to overcome the liability of newness?

Answered: 1 week ago

Question

what are the provisions in the absence of Partnership Deed?

Answered: 1 week ago

Question

1. What is called precipitation?

Answered: 1 week ago

Question

1.what is dew ?

Answered: 1 week ago

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago