Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Java Programming using Eclipse. - Create Person class which includes firstName,

ID: 3860694 • Letter: J

Question

Java Programming using Eclipse.

- Create Person class which includes firstName, middleName, lastName, multiple phone numbers, multiple addresses(should contains street, city, state, and country), multiple notes, and groupName.

- Write Week05_yourName_Assignment.java to display the menu such as 1 for writeData, 2 for readData, and x for terminating the program.

- Week05_yourName_Assignment.java should create 10 Person objects to serialize and 3 of them has 3 phones and 2 addresses, 2 of them has 3 notes and 2 phones.

- Note: be careful where to store serialization file and read from.

Explanation / Answer

package chegg;

import java.io.buffered reader;
import java.io.buffered reader;
import java.io.file;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.Util.Scanner;
class Person
{
String firstName;
String middleName;
String firstName;

String lastName;
String Group_Name;
String city;
}
}
String state;
String street;
String country;
Long phone _num[]=new Long[100];
String notes[]=new String[100];
int i=0,n=0;
person(Long phone)
{
phone_num[i]=phone;
i++;
}

person(String street,String city,String state,String country)
{

this.street=street;
this.city=city;
this.state=state;
this.country=country;
}

person(String note)
{
notes[i]=note;
n++;
}

void method(PintWriter obj)
{
for(int i=0;i<2;i++)
{
obj.print(phone_num[i]);
}
}
}

public class week05_yourName_Assignment
{

public static void main(String[] args) throws IOException
{
FileWriter output =new FileWriter("D:\Newfolede\output.txt");

PrintWriter obj=new PrintWriter(output);
BufferedSWriter out=new BufferedWriter(output);
Scanner sc=new Scanner(System.in);
Person obj1 = new person(123456);
Person obj2 = new person(133456);
Person obj3 = new person(143456);
Person obj4 = new person("c colony","vizag",
"AP","india");

Person obj5 = new person("mg road","vijayawada","ap","indoia");

Person obj6 = new person("this is note 1");
Person obj7 = new person("this is note 2");
Person obj8 = new person("this is note 3");
Person obj9 = new person(2334346456);
Person obj10 = new person(2344534536);
obj2.method(obj);
out.close();
while(true){
System.out.println("MENU");
System.out.println("1.write data");
System.out.println("2.read data");
System.out.println("3.terminating");
System.out.println("enter ur choice");
int opt=sc.nextInt();
switch(opt){
case 1:
break;

case 2:

break;

case 3:

System.exit(0);

default:

System.out.println("wrong choice selected:")

}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote