A class skeleton for each class you will create A class skel
A class skeleton for each class you will create. A class skeleton includes just the variables and the first line of the methods that will be implemented in each class.
Your completed skeleton will also include a main() that
i) creates an object of each of the other classes,
 ii) calls each method on each of the objects it creates, and
 iii) prints a message at the end that shows that the entire program compiled and ran.
You must submit the class skeleton source code files together with a recording of the run (copy and paste the console to the bottom of the main().) Be sure that each person puts their initials in a comment by the code that they write.
A list of the prewritten classes and interfaces that you will be using. These are classes and interfaces from the Java API that you plan on using.
A specification for the user interface for your Contact List. This will be a recording of the run of your program after you have fully implemented all of the use cases. Since your program is not written yet, you will need to type this \"fake recording\" into an editor, word processor or Google doc. NO DESCRIPTION is called for here! What you type will be exactly what will appear on the console when your completed program runs. Text that will not appear on the console when your completed Task 4 runs does not belong here! This document will make sure that everyone on the team is clear about what you are trying to build.
Below is the requirement for the coding
https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxvcmdhbml6ZXlvdXJ0ZWFtfGd4OmVlMzBkZDZmMDk0OTU0MA
Solution
Code:
 package contactlist;
import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.PrintWriter;
 import static java.lang.System.exit;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.Scanner;
public class ContactList {
    static Scanner sc=new Scanner(System.in);
     static Contacts c[]=new Contacts[20];
     static int count=0;
   
     public static void main(String[] args) throws FileNotFoundException {
         int choice;
         do
         {
             System.out.println(\"1: Add Person to contact list\");
             System.out.println(\"2: Print the contact list\");
             System.out.println(\"3: Retrieve person information by last name\");
             System.out.println(\"4: Quit the program\");
             System.out.println(\"5: start the program\");
             System.out.println(\" Enter the choice\");
             int ch=sc.nextInt();
             switch(ch)
             {
                 case 1:add_person();
                       break;
                 case 2: print_contactList();
                       break;
                 case 3: find();
                       break;
                 case 4:write();
                         break;
                 case 5:read();
                         break;
                 default:System.out.println(\"Invalid choice\");
                         break;
                              
                        
              }
             System.out.println(\"Do you want to continue : 1/0\");
             choice=sc.nextInt();
           
         }while(choice==1);
       
     }
 
     public static void add_person()
     {  
         System.out.println(\"Enter the first name\");
         sc.nextLine();
         String first=sc.nextLine();
         System.out.println(\"Enter the last name\");
         String last=sc.nextLine();
         System.out.println(\"Enter the street address\");
         String address=sc.nextLine();
         System.out.println(\"Enter the email address\");
         String email=sc.nextLine();
         System.out.println(\"Enter the phone number\");
         String phone=sc.nextLine();
         System.out.println(\"Enter notes\");
         String notes=sc.nextLine();
         if(last!=null)
         {
             c[count]=new Contacts(first,last,address,email,phone,notes);
             count++;
         }
     }
     public static void print_contactList()
     {
         for(int k=0;k<count;k++)
         {
           
                 System.out.println(\"First name: \"+c[k].firstName);
                 System.out.println(\"Lastt name: \"+c[k].lastname);
                 System.out.println(\"Street address: \"+c[k].streetaddress);
                 System.out.println(\"Phone number: \"+c[k].phonenumber);
                 System.out.println(\"email address\"+c[k].emailaddress);
                 System.out.println(\"Notes: \"+c[k].notes);
               
            
         }
         Arrays.sort(c);
     System.out.println(Arrays.asList(c,0,count-1));
     }
   
     public static void find()
     {
         String name;
         System.out.println(\"Enter the last name to search\");
         name=sc.nextLine();
         for(int k=0;k<count;k++)
         {
             if(c[k].lastname.equals(name))
             {
                 System.out.println(\"First name: \"+c[k].firstName);
                 System.out.println(\"Lastt name: \"+c[k].lastname);
                 System.out.println(\"Street address: \"+c[k].streetaddress);
                 System.out.println(\"Phone number: \"+c[k].phonenumber);
                 System.out.println(\"email address\"+c[k].emailaddress);
                 System.out.println(\"Notes: \"+c[k].notes);
               
              }
         }
       
     }
   
     public static void write()
     {
         try(FileWriter f = new FileWriter(\"contact.txt\", true);
         BufferedWriter b = new BufferedWriter(f);
         PrintWriter out1 = new PrintWriter(b))
         {
             for(int i=0;i<count;i++)
             {
                 out1.println(c[i].firstName+\" \"+c[i].lastname+\" \"+c[i].streetaddress+\" \"+c[i].emailaddress+\" \"+c[i].phonenumber+\" \"+c[i].notes);
             }
         } catch (IOException e) {
              //exception handling left as an exercise for the reader
         }
     }
      public static void read() throws FileNotFoundException
      {
          try (BufferedReader b = new BufferedReader(new FileReader(\"contact.txt\"))) {
           String line;
            while ((line = b.readLine()) != null)
                         {
                             String [] tok = line.split(\"\\\\s+\");
                             String first = tok[0];
                             String last = tok[1];
                             String street = tok[2];
                             String email=tok[3];
                             String phone = tok[4];
                             String notes = tok[5];
                             c[count]=new Contacts(first,last,street,email,phone,notes);
                             count++;
               
            }
       } catch (IOException e) {
           
        }
    }
    
 }




