Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE HELP WITH THIS JAVA PROGRAM. Creating a small credit card accounting system program that uses hashtables. The database will keep track of accounts for

PLEASE HELP WITH THIS JAVA PROGRAM. Creating a small credit card accounting system program that uses hashtables. The database will keep track of accounts for a company that issues credit cards and allows a restricted set of database operations. The program must also provide a nice interface to present to the user: The data that will be tracked for an account is the following: 1. the credit card number (sixteen digits), this will be the key field that must be unique. 2. the name of the card holder, 3. the credit limit for that card (a double), and 4. the current balance on that card (a double). The operations that the program will support are: 1. account creation, a. there cannot be two accounts with the same key added to the system 2. account deletion, 3. credit limit adjustment, a. increase or decrease a users credit limit 4. Making a purchase on the card. a. Only runs valid purchase. Otherwise prints an error message 5. Print out a single account a. Use a similar format as used for printing all accounts 6. Print out all accounts a. Should include evenly spaced columns (use String.format ) b. Everything should be in alphabetical order based upon the cardholders name (try to look at Collections.sort ) c. Should include: the name, card number , credit limit and balance 7. Run a Database operations file of actions a. This action will ask the user for an input file that contains a list of actions the program must execute. The format of this file is discussed later. b. No user input is required when running each individual action 8. Everything is run until the user requests to exit For a fully useful program, other operations (especially accepting payments against the balance) would be required but the logic of their design is similar to the ones listed and thus they are not included in this assignment. You will be required to read in from a file. The input file are on BB. November 21, 2017 [COMP 2503 ASSIGNMENT 5 - HASHING] Page 2 of 3 The Database Operations File To allow for the scripted input of actions against the database you will read the operations to perform from a file. You may assume that the file is well formed. The operations will be specified on a single line. The arguments to the operation will be on subsequent lines. There will be no leading or trailing whitespace for any of the fields in the file. Credit card numbers will be formatted as 16 digit numbers. cre Add a record to the file. The record information will occupy the next 4 lines in the order: credit card number, name of card holder, credit limit, and balance. del Mark a record as deleted. The following line will contain the credit card number of the record to be deleted. lim Change the credit limit field in the record specified by the credit card number given. The line following the lim command will contain the credit card number and the line after the credit card number will contain the new limit. pur Cause a purchase transaction to occur if the additional information specifies a valid purchase operation. Otherwise, an error message will be displayed. The line following the pur command will contain the credit card number and the line after the credit card number will contain the amount of the purchase.

This is the test file.

test.txt cre 1111111111111111 Vicente Lynn 21000 0 cre 0000000000000000 Allan Clark 43100 0 cre 1111111111111111 Poop 43100 0 cre 2222222222222222 poop2 -43100 0 pur 1111111111111111 21001 pur 0000000000000000 500 pur 0000000000000000 1000 del 5391760529966042 pur 0000000000000000 43100 lim 0000000000000000 100000 pur 0000000000000000 43100 lim 0000000000000000 100 lim 0000000000000000 -100

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 Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago