Phone Records
As part of its work ‘logging’ all telephone calls, the NSA requires a way to save and ultimately correlate phone logs.
As a first step, it has been suggested that a hash table be used to keep a list of all calls to/from a specific number. Hash tables are known to provide O(1) access. The original design specification is to use a telephone number (a String) as the table key and a list of call records for the table entry.
A call record contains the ‘other’ phone number, the date/time, and duration of the call. Call records are obtained from the Telco’s billing records, as such, for each call placed there will be (in most cases) another matching received call.
- As a first cut, create a program to perform the following:
1. Read a data file of billing records
2. Create a call record and enter each record into the hash table, and,
3. Print a list of each call record for each entry in the table.
- Because multiple calls can be made/received from the same number, each hash table entry needs to be a list – an ordered list according to call time.
- Aside from containing the relevant call data, a CallRecord class will contain the appropriate accessor and mutator methods plus any additional methods required to support the functionality described above.
The file will contain multiple lines of billing records, one per line. The format, in whitespace separated form, is as follows:
- n-digit telephone number – (String)
- n-digit telephone number called/received – (String)
- To/From indicator (1,0) – (Integer)
- Number of minutes used – (Integer)
- Day of year (1-366) – (Integer)
- Call time (24 hour format) hours – (Integer)
- Call time minutes – Integer)
- Call time seconds – (Integer)
*US telephone numbers are 10 digits long, however, international numbers can be of varying lengths.
Sample Input – TelcoIn.txt
9997751000 8005551212 1 65 10 11 01 00
9997751000 9991551212 0 45 15 12 01 00
9997751000 8005551212 1 120 10 11 01 00
9995551234 8005551212 1 645 311 10 01 00
9997751000 8005551212 1 65 312 22 59 59
9997751000 8005551212 1 13 313 22 10 31
9997751000 8005551212 1 35 355 11 00 10
9991551212 9997751000 1 45 15 12 01 00
**You may use java collections**

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;

* @author
public class Project5 {
    public static void main(String[] args) {
       HashTable ht = new HashTable();
       Scanner keyboard = new Scanner(;
       System.out.print("Enter name of input file: ");
       String file =;
       readFile(ht, file);
       System.out.println("" + ht.toString());

By purchasing this solution you'll be able to access the following files:

for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats