Question: Need someone to write JAVADOC for this coding? ---------------------------------------- package com.koothada; import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Scanner; class Contact { String FirstName; String

Need someone to write JAVADOC for this coding?

----------------------------------------

package com.koothada; import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Scanner; class Contact { String FirstName; String LastName; long PhoneNumber; public Contact(String FirstName, String LastName,Long PhoneNumber) { this.FirstName=FirstName; this.LastName=LastName; this.PhoneNumber=PhoneNumber; } @Override public String toString() { return "Contact [FirstName=" + FirstName + ", LastName=" + LastName + ", PhoneNumber=" + PhoneNumber + "]"; } } public class ContactApp { public static void main(String[] args) throws FileNotFoundException { Scanner sc=new Scanner(System.in); ArrayListlist=new ArrayList();//create a Array list to Store All the Contact Details File contact_details = new File ("F:\\Workspace_Luna\\Contactlist.txt");//Reading Contact details from the File Scanner scanner = new Scanner(contact_details); String Firstname,Lastname; long Phone; Contact contactlist; while(scanner.hasNextLine()) { Firstname = scanner.next();//Read First word of line in file as FirstName Lastname = scanner.next();//Read Second word of line in a File as Second Name Phone=scanner.nextLong();//Read the Third word of line as Phone Number contactlist=new Contact(Firstname,Lastname,Phone);//Passing Input parameters through Constructor reading from the File. //or Otherwise your wish Pass Arguments through the Constructor only //like contactlist=new Contact("venkanna","Koothada",9949468557); list.add(contactlist); } scanner.close(); System.out.println("The contact Details from the file is"); for(Contact obj:list) { System.out.println("FirstName: "+obj.FirstName+" LastName: "+obj.LastName+"PhoneNumber:"+obj.PhoneNumber); } //Or Use toString Method to print All the contact information. //System.out.println(contactlist); while(true) { System.out.println("*** Main Menu ****"); System.out.println("1.Add New Contact"); System.out.println("2.Search Contact"); System.out.println("3.Edit Contact"); System.out.println("4.Exit"); System.out.println("please Select any option"); int option=sc.nextInt(); boolean status = false; switch(option) { case 1: System.out.println("Please Enter Firstname:"); Firstname=sc.next(); System.out.println("Please enter LastName:"); Lastname=sc.next(); System.out.println("Please Enter MobileNumber"); Phone=sc.nextLong(); contactlist=new Contact(Firstname,Lastname,Phone); list.add(contactlist); System.out.println("New Contact Details Are Added Successfully"); break; case 2: System.out.println("Please Enter Phone Number"); Phone=sc.nextLong(); for(Contact obj:list) { if(Phone==obj.PhoneNumber) { status=true; System.out.println("FirstName: "+obj.FirstName); System.out.println("LastName: "+obj.LastName); break; } } if(status==false) System.out.println("Contact Details are not found"); break; case 3: System.out.println("Please Enter Phone Number"); Phone=sc.nextLong(); for(Contact obj:list) { if(Phone==obj.PhoneNumber) { status=true; System.out.println("FirstName: "+obj.FirstName); System.out.println("LastName: "+obj.LastName); System.out.println("Please Enter New Mobile/Phone Number:"); Phone=sc.nextLong(); obj.PhoneNumber=Phone; System.out.println("New Phone Number Updated Successfully"); break; } } if(status==false) System.out.println("Contact Details are not found"); break; case 4: System.out.println("Terminated Successfully"); System.exit(0); default: System.out.println("Invalid Option please try again"); } sc.close(); } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!