AP Level AB - Post AP Problems



  1. Create a file with TextPad with 20 names - last then first on different lines. Read the information into an ArrayList of a name class which holds a first and last and implements Comparable. Sort the names and then print them out.
    You can find information on reading text with Java here
  2. Write a method that will take a long integer as a parameter and return an ArrayList. Each element of the ArrayList should hold a single digit. So, if the number to be converted was 1266448, the 0 spot would hold 8, the 1 spot would hold 4. etc,
  3. Write a method that will take 2 ArrayList of Integer as parameters and return an ArrayList which is the sum of the other 2.
  4. Print out the prime numbers from 1 to 10,000 using the Sieve of Erasthenes, which is described here
  5. Write a method that will receive an ArrayList with 10 names and write them to a file. Code for writing to a file is Here
  6. Write a telephone directory program that will let you enter a name and a telephone number and will put it into a HashTable (search by last name + first name). When you Quit the program will write the name (last + first) on one line of a file followed by the telephone number. When you open the program the names and numbers in the file (if any) will be read into the HashTable (name is key - phone is value). You should have features to Get Phone Number, Change Phone Number, Enter New Name and Number and Quit. When you enter a last name everyone with that last name should be printed with their first name and number. If you enter a last and first name only that person's phone number will be printed.
  7. Create an account and log in to projecteuler.net. Do the first 10 problems. Keep copies of your code