Question: What is the code for this? 1 . Include phone number ( in the format xxx - xxx - xxxx ) in each record 2
What is the code for this?
Include phone number in the format xxxxxxxxxx in each record
No duplicated ID allowed
Add method swapint id int id to swap the location of id and ids references in the list
Add method modifyint id String lastName, String firstName, double GPA, String phone to modify the id's record. If such id does not exist, add it as a new record into the list
class Student
private int id;
private String firstName;
private String lastName;
private double gpa;
public Studentint inid String infName, String inlName,
double g
id inid;
firstName infName;
lastName inlName;
gpa g;
public int getIDreturn id;
public String getfNamereturn firstName;
public String getlNamereturn lastName;
public double getGPAreturn gpa;
public class StudentList
protected int length;
protected int currentpos;
protected Student list;
public StudentList
list new Student;
length ;
currentpos ;
public StudentListint size
ifsize size ;
list new Studentsize;
length ;
currentpos ;
public void makeEmpty
forint i;ilist.length;
public int lengthIs
return length;
private int retrieveIndexint id
boolean found false;
int current ;
whilefound && current
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
