Reference no: EM13940831
Create a class with a method that accepts a charge card account number as its argument. The method should determine whether the number is valid by comparing it with a list of valid charge card account numbers. The comparison should be accomplished using a search. If the account number to be checked is in the list of valid account numbers, the method should return true and if the number is not in the list, the method should return false.
The valid account numbers are stored in a file named valid_accounts.txt. A copy of this file should have accompanied this exam. You should create a method that will read the valid charge card account number list and return an array or arrayList object with the 7 digit integer values stored in the file (none of the numbers start with the digit zero).
The account numbers to be checked are stored in a file named accounts_to_check.txt. A copy of this file should have accompanied this exam. You should use the same method as above that will read the charge card account number list and return an array or arrayList object with the 7 digit integer values stored in the file (none of the numbers start with the digit zero).
You should also create a method that takes an array or arrayList object, arranges the charge card account numbers in ascending order and returns the sorted array or ArrayList object.
Demonstrate your class methods in a driver program by reading the charge card account numbers to be checked for validity from a file named accounts_to_check.txt, testing to see if each number that is in the file is valid, and displaying the result of that check in a report. Consider your output a report that someone could easily verify against a sorted valid accounts list. Output two additional reports: A sorted valid accounts list and a sorted accounts to check list.
If you use an ArrayList, you will have to do some independent research to accomplish this solution. Be sure to document any classes or methods you use outside the scope of chapters 1-8 in the book.
The files valid_accounts.txt and accounts_to_check.txt accompany this Final Exam document.
valid_accounts.txt:
9219306
7569177
4256928
4364059
6221744
3176698
7187438
4484503
8937630
6389278
3933096
7342775
2877438
5426950
9982031
4654335
5045697
5034644
6989075
8314073
1613911
1335305
6196903
8449641
1545292
4906480
1336532
3124745
7122978
1800843
7934692
6551425
8461254
1559757
4192728
1025121
1417918
1751466
5200307
4082692
3509247
7145465
9860616
1128882
2396421
5390896
2311287
3545377
1886054
6429595
accounts_to_check.txt:
2197966
4256928
1075220
2877438
4378016
8314073
2073673
8449641
8073168
1800843
4119317
1025121
8282263
4082692
5950660
2396421
5434498
9152307
3545377
8039204
1336532
6135520
8461254
4654335
7187438
Calculate the percentage saving in weight
: The drive shaft to a boat's propeller is 50 mm in diameter. If a 25 mm diameter hole is bored along its length calculate the percentage saving in weight and the percentage reduction in torsional streng
|
Prepare the statement of cash flows of dux company
: Prepare the statement of cash flows of Dux Company for the year ended December 31, 2011. Present cash flows from operating activities by the direct method. (You may omit the schedule to reconcile net income to cash flows from operating activities...
|
Online commercial job boards
: Collect 10 job advertisements from sources including online commercial job boards , linked In.com and government or military websites. These jobs must be for entry-level HR positions or for HR graduates.
|
Distinguish among the risk principle, the needs principle
: Why is the family "system" such a powerful unit? How could such a system contribute to an adolescent becoming delinquent? How could such a system help rehabilitate a delinquent family member?
|
Create a class with a method that accepts a charge card acnt
: Create a class with a method that accepts a charge card account number as its argument. The method should determine whether the number is valid by comparing it with a list of valid charge card account numbers
|
What information would you request from the retailer
: What additional questions would you raise, and what information would you request from the retailer to answer these questions?
|
Determine the minimum dimensions of the crosssection
: Determine the minimum dimensions of the crosssection and the radius of curvature at the point of maximum stress.
|
What are challenges of creating a counterterrorism policy
: What are the challenges of creating a counterterrorism policy? Counterterrorism measures and policies are being created and implemented internationally. Do you think that counterterrorism policies are effective and can help control and combat terr..
|
Plot the shear force and bending moment diagrams
: Plot the shear force and bending moment diagrams and determine the maximum stress due to bending, the factor of safety in operation if the UTS of the material is 500 MPa, and the value radius of curvature between the suspension points.
|