Encerrado

java1 project

You are the till attendant at a department store. At the start of the day your computer will read from file the customers database and store the customer’s details in memory. Then, during the day a series of customers will join a queue. Some will be new customers who must be added to the database. The others will want either to buy something or put money into their account. After such a transaction their account details will need to be updated. At the end of the day the system will write the new database to a file. Each customer has a title and a name (so that u can address him or her with a polite personal message and wish him or her a “nice day?? when he or she lives), an account number and a balance. The database is a series of such customers. The name is a string, the account number and the balance are integers. The database consists of a series of such customers, each detail on a separate line, e.g a typical file might look something like the following:-

Mr

Whyley

11234

10

Dr

Jones

24153

900

Lady

Thatcher

63514

10000000000

## Deliverables

The account number is always on the third line with the balance on the fourth. You may assume that no customer is allowed, or would ask for, credit, i.e all account balances will always be positive. The day’s actions will be kept in a separate file. The first line of each entry in this file will be a string, either **join** or **transact**. If it is **join** then the customer will join the back of the queue. The second line in this case will be the customer’s title and the third line will be his/her name. If the first line is **transact** the customer will either be paying money into his store account or buying an item. The second line will be either the string **buy** or **pay**. In either case the third line will be the amount of money which needs to be added or subtracted from their account. Note that you will not be given the name or account number for a transaction, it will simply be the first person in the queue. You must print to screen the details of the day trading. If a customer joins the queue you must report their title and name, i.e “[url removed, login to view] has joined the queue??. If there is a transaction you must say e.g “Good day Lady Thatcher??.

First of all write the code for a **Customer** class. It will need features for the name, title, et.c. These should all be declared as private. You will need methods for returning these features and a **constructor** which will take as an parameter list all the details read from the file. You will also need methods to add and subtract from their account. Save this file as **[url removed, login to view]**(remember case sensitivity). Next consider the database class. How you store the data is up to you, consider an array or a list and look up on **[url removed, login to view]** web-site how to use these classes. You will need features to construct the database (there will of course only be one), how to add a customer in the database, how to search tha database for a customer’s name, balance and title and how to rewrite the database to a file at the end of the day. This file will be called **Database.java.** Again you must consider security and code hiding. The next task is to write a **Queue** class. You will need to consider storage, adding to the back, getting information from the front person, removing the front person, etc. Finally u should write the **Store** class which will contain the **main** method and run the program**.** This will need to read the database, construct **Customer** objects and add them to the **Database** object. It will then read the transaction file one piece at a time, reporting on the state of the queue or transaction. It will update the queue for each action, and update customer’s records where necessary. When the file is finished and the query is empty it will report “Closing time?? and rewrite the database.

Accurate reporting of the state of the queue and a correct final database is what is required here.

**HINTS**

Write, save and test each class separately. You should write a separate testing class for each class as you write it. Make sure that you test each class as you write it and do NOT wait until the whole program is written before debugging. You will need to write your own test data. I will be testing it using my own files, therefore you must pay attention to all possible inputs. You may assume that the queue will only be empty at the start and end of the program. There will be no trick data. Customers will not attempt to carry out a transaction unless they are in the queue, there will be no negative balances, and all customers who join the queue will have an account.

is the **Queue** class. Call the new file P_queue.java.

## Platform

windows

Habilidades: Engenharia, Java, MySQL, PHP, Arquitetura de software, Teste de Software

Ver mais: what is search string, what is data entry test, what is a search string, what is a data entry test like, u. s. department of state, search string in array, on line data entry test, need java on my computer, method to write a report, make money with java, list of positive integers, java1, how to write security report, how to write a project report, how to read computer code, how to do data entry in computer, how should i write my it report, first class objects in java, dr first, data entry classes, database queue, what is object, how to make money with data entry, update account details, sun screen

Acerca do Empregador:
( 1 comentário ) Greece

ID do Projeto: #3008943

9 freelancers estão ofertando em média $10 para este trabalho

mihaiscortaru

See private message.

$12.11 USD in 3 dias
(160 Comentários)
6.0
intelliartsteam

See private message.

$8.5 USD in 3 dias
(36 Comentários)
5.7
leepwo

See private message.

$12.75 USD in 3 dias
(41 Comentários)
4.7
absolutredbull

See private message.

$12.75 USD in 3 dias
(56 Comentários)
3.9
txplorer

See private message.

$12.75 USD in 3 dias
(37 Comentários)
3.7
ciphereye

See private message.

$11.05 USD in 3 dias
(16 Comentários)
2.7
jonbk

See private message.

$4.25 USD in 3 dias
(6 Comentários)
2.3
ashleevw

See private message.

$5.95 USD in 3 dias
(4 Comentários)
0.2
patrichia

See private message.

$12.75 USD in 3 dias
(0 Comentários)
0.0