Create a class with a method that accepts a charge card acnt

Assignment Help JAVA Programming
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

Reference no: EM13940831

Questions Cloud

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.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create simple java application that uses the string class

Create your own simple Java application that uses the String class and/or the StringBuffer class and at least 4 of the class methods. Show the code, demonstrate it works properly and describe what it is doing.

  Program that uses random instead of scanner to play

Write a Java Program that uses Random instead of Scanner to play many rounds of Rock Paper Scissors. The user and computer will each randomly pick one and common rules of winning apply

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Design and implement a small and simple email server using

design and implement a small and simple email server using the concept of web based information system wbis. your

  Special car rental code from the license plate

When you rent a car from an agency, the key ring has several pieces of information: license plate, make and year of car, and usually a special code. This code could be used for some data processing within the company's computers. This lab will practi..

  Method level comment

What type of information should be included in a method level comment?

  Creates an array with x randomly generted integer elements

Write a program DuplicateTester.java that prompts user for a posi- tive integer x and creates an array with x randomly generted integer ele- ments in range 0 to 9. Use a method with signature public static int[] removeDuplicates(int[] array); to remo..

  Statements to create a collection of integers

Write Java statements to create a collection of integers, and to initialize each element of the collection to -1. Then, using a for each statement to print the value of each element.

  Why do i not create a constructor for an applet

When should one use applets and when should one use servlets? Why do I not create a constructor for an applet? Why doesn't appletviewer appletclass.class work?

  Write program that convert us dollar into canadian dollar

Design a new class named Polygon that extends GeometricObject and implements Comparable. The number of sides in polygons varies, you cannot use a certain number of data fields for sides of a polygon - Write a program that passes an unspecified numb..

  Program with backtracking removing all gotos

Please fix the below program with backtracking removing all gotos  and also run the program before posting it and please comment before each line or explain such as what this line means or does .

  Rebalancing a binary search tree

Your task is to write a class RebalancingTree that extends the attached BST class. You should override the insert method in BST. Your overriding method should first call the method it is overriding

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd